Terry Lambert writes:
> [EMAIL PROTECTED] wrote:

>> There are only two shared libaries in common (libc and libm) and
>> both are the same on FreeBSD (in /compat/linux) and Linux.
>>
>> So any ideas on where the program is going wrong?
>
> man fpsetround

That won't change a thing. Both systems round to nearest.

> The defaults for the Linux emulator are different than
> the defaults for Linux.  Linux sets some stuff up wrong,

FreeBSD sets stuff up wrong. This is a choice between bad
and worse, since the CPU does not support what you want.

An x86 CPU has a rounding precision that may be set for
float, double, or long double. FreeBSD sets the CPU to
make double work, giving extra fraction bits for float
and truncating long double. Linux sets the CPU to make
long double work, giving extra fraction bits for both
float and long double. Now what is worse, getting some
extra bits in an intermediate calculation or truncation?
Note that the FreeBSD setting causes _both_ problems.

See float_t, double_t, FLT_EVAL_METHOD and FLT_ROUNDS in
the 1999 C standard for ways to deal with x86 hardware.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to