This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rs6000: floating point cast oddities?



On Monday, December 17, 2001, at 09:07 AM, degger@fhm.edu wrote:

> Hija,
>
> Consider:
> float
> foo (float a, float b)
> {
>   return b+1.0;
> }
>
> What I expect it do to is:
> Load a single precision 1.0 and add it to the register
> of the second parameter.

No, according to the language 1.0 is double, and the addition
should therefore be done in double.  You can write 1.0f to
specify a float 1.0.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]