Liste des Groupes | Revenir à c arch |
mitchalsup@aol.com (MitchAlsup1) writes:You know POSIX better than I do, but AFAIK "math_errhandling" is a fixed value set by the implementation, usually as a macro. Certainly with a quick check with gcc on Linux, I could not set the bits in math_errhandling.On Mon, 13 Jan 2025 21:53:55 +0000, Scott Lurndal wrote:POSIX leaves it up to the programmer to decide. If the
>mitchalsup@aol.com (MitchAlsup1) writes:>On Mon, 13 Jan 2025 18:02:10 +0000, Thomas Koenig wrote:>
>MitchAlsup1 <mitchalsup@aol.com> schrieb:>
>errno is an atrocity all by itself; single handedly preventing>
direct use of SIN(), COS(), TAN(), ATAN(), exp(), ln(), pow()
as instructions.
Fortunately, the C standard does not require errno to be set
for these functions. Apple, for example, does not do so.
Nor will I.
POSIX does, however, require errno to be set conditionally
based on an application global variable 'math_errhandling'.
The functions mentioned have the property of taking x as
any IEEE 754 number (including NaNs, infinities, denorms)
and produce a IEEE 754 number {NaNs, infinities, norms,
denorms}.
>
But if POSIX wants to spend as many cycles setting errno
as performing the calculation, that is for POSIX to decide.
programmer desires EDOM or ERANGE, they set the
appropriate bit in math_errhandling before calling the
sin et alia functions.
Les messages affichés proviennent d'usenet.