Numworks Epsilon  1.4.1
Graphing Calculator Operating System
double.c
Go to the documentation of this file.
1 #include <quiz.h>
2 #include <assert.h>
3 
4 QUIZ_CASE(double_arithmetic) {
5  assert((float)1.123456789101112 == 1.123456789101112f);
6  assert((double)1.12345f - 1.12345< 0.0000001);
7  assert(3.12+2.00001 - 5.12001 < 0.0000000001);
8  assert(1e106+1e104 - 1.01e106 < 0.0000000001);
9  assert(1e-106+1e-104 - 1.01e104 < 0.0000000001);
10  assert(3.12345678901234567890/2.0000000000000001 - 1.56172839450617276136 < 0.0000000001);
11  assert(1.09876e206/2.45678e207 - 0.04472358127304846180773 < 0.0000000001);
12  assert(3.12345678901234567890*2.0000000000000001 - 6.24691357802469167014 < 0.0000000001);
13  assert(1.09876e106*2.45678e107 - 2.6994115928e213 < 0.0000000001);
14  assert(-3.12345678901234567890+2.0000000000000001 == -1.1234567890123457);
15  assert(-1e36+1e34 + 9.9e35 < 0.0000000001);
16  assert(3.12345678901234567890-2.0000000000000001 == 1.1234567890123457);
17  assert(1e36-1e34 - 9.9e35 < 0.0000000001);
18 }
#define assert(e)
Definition: assert.h:9
QUIZ_CASE(double_arithmetic)
Definition: double.c:4