Revision e4811e4c
Added by Bourbouh about 5 years ago
include/conv.c | ||
---|---|---|
1 |
#include <math.h> |
|
1 | 2 |
int real_to_int (double in1) { return (int)in1; } |
3 |
int _Floor (double in1) { return (int)floor(in1); } |
|
4 |
double _floor (double in1) { return floor(in1); } |
|
5 |
int _Ceiling (double in1) { return (int)ceil(in1); } |
|
6 |
double _ceil (double in1) { return ceil(in1); } |
|
7 |
int _Round (double in1) { return (int)round(in1); } |
|
8 |
double _round (double in1) { return round(in1); } |
|
2 | 9 |
|
3 | 10 |
double int_to_real (int in1) { return (double)in1; } |
include/conv.lusi | ||
---|---|---|
1 | 1 |
function real_to_int (in1: real) returns (out: int) prototype C; |
2 |
function _Floor (in1: real) returns (out: int) prototype C; |
|
3 |
function _floor (in1: real) returns (out: real) prototype C; |
|
4 |
function _Ceiling (in1: real) returns (out: int) prototype C; |
|
5 |
function _ceil (in1: real) returns (out: real) prototype C; |
|
6 |
function _Round (in1: real) returns (out: int) prototype C; |
|
7 |
function _round (in1: real) returns (out: real) prototype C; |
|
8 |
|
|
2 | 9 |
function int_to_real (in1: int) returns (out: real) prototype C; |
Also available in: Unified diff
add more conversion libraries