octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #42583] log2() returns inaccurate result for m


From: Rik
Subject: [Octave-bug-tracker] [bug #42583] log2() returns inaccurate result for many integer powers of 2, unlike Matlab
Date: Sun, 26 Feb 2023 21:39:34 -0500 (EST)

Follow-up Comment #27, bug #42583 (project octave):

I've had bad experiences with the '-ffast-math' option.  The documentation
from gcc for -ffast-math is:


       -ffast-math
           Sets the options -fno-math-errno, -funsafe-math-optimizations,
-ffinite-math-only,
           -fno-rounding-math, -fno-signaling-nans, -fcx-limited-range and
-fexcess-precision=fast.

           This option causes the preprocessor macro "__FAST_MATH__" to be
defined.

           This option is not turned on by any -O option besides -Ofast since
it can result in incorrect
           output for programs that depend on an exact implementation of IEEE
or ISO
           rules/specifications for math functions. It may, however, yield
faster code for programs that
           do not require the guarantees of these specifications.


It seems possible that having even one module compiled with -ffast_math might
contaminate others.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?42583>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]