History

Revert "add tests for float conversions to u64"

Because test's are not applicable in this case. This reverts commit a5e714abecfe6f3a94c7cdc231906191ce2491f1.

Kyryl Melekhin committed 6 years ago

Commit 55b47541 parent c9bbd4e2 files · +2 −38Browse files

Unified · Split

2 files
  1. tests/tests2/22_floating_point.c +1 −31
  2. tests/tests2/22_floating_point.expect +1 −7
tests/tests2/22_floating_point.c+1−31
@@ -14,12 +14,6 @@ test() · 13 unmodified lines
14 }14 }
15}15}
16 16
17double coerce(double x)
18{
19 x++;
20 return x;
21}
22
23int main()17int main()
24{18{
25 // variables19 // variables
@@ -61,31 +55,7 @@ int main() · 35 unmodified lines
61 // type coercion55 // type coercion
62 a = 2;56 a = 2;
63 printf("%f\n", a);57 printf("%f\n", a);
64 printf("%f\n", coerce(2));58 printf("%f\n", sin(2));
65
66 //type conversion to unsigned long int
67 float f = 3421.439;
68 double d = 7855.332231;
69 long double ld = 2469.346786989643234;
70
71 unsigned long int i;
72 i = f;
73 printf("%lu\n", i);
74 i = d;
75 printf("%lu\n", i);
76 i = ld;
77 printf("%lu\n", i);
78
79 f = -3421.439;
80 d = -7855.332231;
81 ld = -2469.346786989643234;
82 i = f;
83 printf("%lu\n", i);
84 i = d;
85 printf("%lu\n", i);
86 i = ld;
87 printf("%lu\n", i);
88
89 59
90 return 0;60 return 0;
91}61}
tests/tests2/22_floating_point.expect+1−7
@@ -13,10 +13,4 @@ · 12 unmodified lines
1312.3400001312.340000
14-12.34000014-12.340000
152.000000152.000000
163.000000160.909297
173421
187855
192469
2018446744073709548195
2118446744073709543761
2218446744073709549147

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t