Mail Archives: djgpp/1996/12/02/09:16:13
Chris Waters wrote:
>
> Francois Charton <deef AT pobox DOT oleane DOT com> wrote:
>
> >This is quite interesting : the "more precise" 80bit number, or the cast
> >to double gives the wrong answer (mathematically I mean), whilst the
> >"rough" float truncate yields the right one... (And the truncated number
> >is bigger than the "less truncated" one: this is not what could be
> >expected from a truncature operation on a positive number).
>
> Double to float involves round-to-nearest, rather than truncation, I'll
> bet.
In the source compiled by DJGPP; this was handled by the two FPU
instructions:
fstps -12(%ebp)
flds -12(%ebp)
so this seems to be quite machine dependent (I wonder what the emulator
would yield...)
Francois
- Raw text -