Changeset bae1e1f in mainline for uspace/app/tester/float/float2.c
- Timestamp:
- 2015-09-01T08:08:47Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 992ffa6
- Parents:
- 1d03e86
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/float/float2.c
r1d03e86 rbae1e1f 39 39 }; 40 40 41 static double results_ceil[OPERANDS] = { 42 4.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 769.0, 1081.0, -600.0, 1.0 43 }; 44 45 static double results_floor[OPERANDS] = { 46 3.0, -3.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0 47 }; 48 41 49 static double results_trunc[OPERANDS] = { 42 50 3.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0 … … 59 67 bool fail = false; 60 68 69 for (unsigned int i = 0; i < OPERANDS; i++) { 70 double res = floor(arguments[i]); 71 int64_t res_int = (int64_t) (res * PRECISION); 72 int64_t corr_int = (int64_t) (results_floor[i] * PRECISION); 73 74 if (res_int != corr_int) { 75 TPRINTF("Double floor failed (%" PRId64 " != %" PRId64 76 ", arg %u)\n", res_int, corr_int, i); 77 fail = true; 78 } 79 } 80 81 for (unsigned int i = 0; i < OPERANDS; i++) { 82 double res = ceil(arguments[i]); 83 int64_t res_int = (int64_t) (res * PRECISION); 84 int64_t corr_int = (int64_t) (results_ceil[i] * PRECISION); 85 86 if (res_int != corr_int) { 87 TPRINTF("Double ceil failed (%" PRId64 " != %" PRId64 88 ", arg %u)\n", res_int, corr_int, i); 89 fail = true; 90 } 91 } 92 61 93 for (unsigned int i = 0; i < OPERANDS; i++) { 62 94 double res = trunc(arguments[i]);
Note:
See TracChangeset
for help on using the changeset viewer.