OpenQNX :: The QNX Community Portal

May 13, 2008 - 08:35 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 52 unlogged users and 2 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jiangning
22 Post subject: double precision issue  PostPosted: Apr 25, 2008 - 03:25 AM
New Member


Joined: Apr 25, 2008
Posts: 1

I have a small program, which exposes different behaviors between QNX GCC and Linux GCC.

#include <stdio.h>

double xx;

main()
{
xx = 8.386248e-02;
printf("%.2e = %e\n", xx, xx);
}

I got the following result on Neutrino with the compilation of QNX gcc 3.3.5,

8.38e-02 = 8.386248e-02

But I got different result as below on Linux with gcc,

8.39e-02 = 8.386248e-02

I checked the binaries generated by different compilers and found the double precision rawdata are the same like below,

.long -252304933
.long 1068857346

So it looks like a glibc problem. Can anybody have answer on this?

Thanks,
-Jiangning
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.