This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Cast difference between GCC on Linux and Forte on Solaris
- From: "Jocelyn Fournier" <joc at presence-pc dot com>
- To: <kisa at centropolisfx dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 12 Jul 2002 23:23:45 +0200
- Subject: Re: Cast difference between GCC on Linux and Forte on Solaris
- Organization: Presence-PC
- References: <01bf01c229ce$0ec0bfb0$9d6a0e50@presencey59n1y> <3D2F47E1.D36CE800@centropolisfx.com>
- Reply-to: "Jocelyn Fournier" <joc at presence-pc dot com>
Hi,
Thank you :)
However, do you think there could be a mean to force the compiler to have
the wanted behaviour without changing anything to the code ?
Thanks and regards,
Jocelyn
----- Original Message -----
From: "Gokhan Kisacikoglu" <kisa@centropolisfx.com>
To: "Jocelyn Fournier" <joc@presence-pc.com>
Cc: <gcc-help@gcc.gnu.org>
Sent: Friday, July 12, 2002 11:19 PM
Subject: Re: Cast difference between GCC on Linux and Forte on Solaris
> this might work better;
>
> ires1 = (int) floor(log(64.0)/log(2.0));
>
> Jocelyn Fournier wrote:
> >
> > 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
>
>
>