Topic : BCD floating point -> integer

Forum : 8051

Original Post
Post Information Post
July 17, 2008 - 9:04pm
Guest

When converting a negative floating point number to integer or long integer,
using the BCD float library, it loses its sign.
Using the IEEE library it rounds toward zero, retaining the sign.
RIDE BN 746

// Test of float -> int conversion
// compile with BCD floating point

#include 

int Itest;
float Ftest;

// Just to fool the optimiser that it's not a constant
float dummy( float x){ return x;}

main(){
   Ftest = dummy(-3.5);  
// With BCD floating point this loses its sign and gets +3
// With IEEE floating point it gets -3
   Itest = Ftest;   
}
Replies
Post Information Post
+1
0
-1
July 31, 2008 - 7:52pm
Guest

Hi Puposet

We have verified and fixed this problem.
Thank you for reporting us this point.
The fix will be available on the next release of RKit51.
If you immediately need a fix for your project please send me an email at

Best regards,
Matloub