Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #include <stdio.h> |
2 | #include <math.h> | ||||
3 | #include <stdlib.h> | ||||
4 | |||||
5 | double convert(long long l) | ||||
6 | { | ||||
7 | return (double)l; | ||||
8 | } | ||||
9 | |||||
10 | int main(int argc, char * argv[]) { | ||||
11 | |||||
12 | long long l = 10; | ||||
13 | double f; | ||||
14 | double check = 10.0; | ||||
15 | |||||
16 | f = convert(l); | ||||
17 | printf("convert: %lld => %f\n", l, f); | ||||
18 | if ( f != check ) exit(1); | ||||
19 | |||||
20 | f = 1234.67; | ||||
21 | check = 1234.0; | ||||
22 | printf("floorf(%f) = %f\n", f, floorf(f)); | ||||
23 | if ( floorf(f) != check) exit(1); | ||||
24 | |||||
25 | return 0; | ||||
26 | } |