Pelles C forum

Pelles C => Bug reports => Topic started by: cane on October 17, 2005, 11:37:35 AM

Title: Precision problem with doubles
Post by: cane on October 17, 2005, 11:37:35 AM
Hi Pelle, I was trying to develop a little program to dump (bin & hex) FPU values (IEEE double precision floating point only). I've compiled it with PellesC 4 and I've noticed a certain lack of precision compared to other compilers (I tried DMC, BCC, VC, OpenWatcom and GCC).

Compile & run the program I've attached and enter 23.85 when prompted.

You'll notice that PellesC will give you these dumps:

IEEE bin: 0 10000000011 0111110110011001100110011001100110011001100110011001
RAW hex:  40 37 D9 99 99 99 99 99

Which are wrong in the last 2 binary digits; while other compilers will give you the correct dumps:

IEEE bin: 0 10000000011 0111110110011001100110011001100110011001100110011010
RAW hex:  40 37 D9 99 99 99 99 9A

Hope this helps.

Thanks, bye.
Title: Precision problem with doubles
Post by: Pelle on October 17, 2005, 04:52:30 PM
It's a known problem with low priority. I might look at it in the future.

Pelle
Title: Precision problem with doubles
Post by: cane on October 17, 2005, 10:57:27 PM
I don't want to sound pedant, but a bug like this seems rather critical, and its correction should be prioritized.
And not only because it prevents me from using PellesC for my present project, but also beacuse:
Title: Precision problem with doubles
Post by: AlexN on October 18, 2005, 07:57:15 AM
Quote from: "Pelle"It's a known problem with low priority. I might look at it in the future.

Until Pelle will patch this problem, you can try to link with msvcrt.lib. In this case your example works correct.