aboutsummaryrefslogtreecommitdiff
path: root/src/unit
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/unit/float.unit11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/unit/float.unit b/src/unit/float.unit
index 0473ffb..b1eb063 100644
--- a/src/unit/float.unit
+++ b/src/unit/float.unit
@@ -33,7 +33,14 @@ suite Basic
33 unitTest( pObj != NULL ); 33 unitTest( pObj != NULL );
34 unitTest( pObj->getType() == Gats::typeFloat ); 34 unitTest( pObj->getType() == Gats::typeFloat );
35 Gats::Float *pFlt = dynamic_cast<Gats::Float *>(pObj); 35 Gats::Float *pFlt = dynamic_cast<Gats::Float *>(pObj);
36// printf("In: %a\nOut: %a\n", dVal, pFlt->getValue() ); 36 Bu::String sHex;
37 for( Bu::String::iterator i = mb.getString().begin(); i; i++ )
38 {
39 sHex += "0123456789abcdef"[(((uint8_t)*i)>>4)&0x0f];
40 sHex += "0123456789abcdef"[(*i)&0x0f];
41 sHex += ' ';
42 }
43 printf("In: %a\nOut: %a\nRaw: %s\n", dVal, pFlt->getValue(), sHex.getStr() );
37 if( isnan( dVal ) ) 44 if( isnan( dVal ) )
38 unitTest( isnan(pFlt->getValue()) == isnan(dVal) ); 45 unitTest( isnan(pFlt->getValue()) == isnan(dVal) );
39 else 46 else
@@ -46,6 +53,7 @@ suite Basic
46 test positive 53 test positive
47 { 54 {
48 rw( 8485738457.0 ); 55 rw( 8485738457.0 );
56 rw( 63723.0 );
49 rw( 0.000000000000001928173 ); 57 rw( 0.000000000000001928173 );
50 rw( 1.0 ); 58 rw( 1.0 );
51 rw( 0.0 ); 59 rw( 0.0 );
@@ -55,6 +63,7 @@ suite Basic
55 test negitave 63 test negitave
56 { 64 {
57 rw( -8485738457.0 ); 65 rw( -8485738457.0 );
66 rw( -63723.0 );
58 rw( -0.000000000000001928173 ); 67 rw( -0.000000000000001928173 );
59 rw( -1.0 ); 68 rw( -1.0 );
60 rw( -0.0 ); 69 rw( -0.0 );