This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Cast difference between GCC on Linux and Forte on Solaris
- From: "Jocelyn Fournier" <joc at presence-pc dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 12 Jul 2002 20:00:50 +0200
- Subject: Cast difference between GCC on Linux and Forte on Solaris
- Organization: Presence-PC
- Reply-to: "Jocelyn Fournier" <joc at presence-pc dot com>
Hi,
I have the following problem :
Let's say I have the following code :
ires1 = (int) (log(64.0)/log(2.0)) ;
Under solaris with forte, ires1 return "6";
Under Linux with gcc 3.1, ires1 return "5";
I would prefer not change the code to (int) ((float) log(64.0)/log(2.0));
Is there any solution to solve my problem and keep the precision under linux
? (compiler options or whatever)
Thanks in advance,
Regards,
Jocelyn Fournier