]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the conversion to use nan_mix() in r336362. fmod*(x, y),
authorBruce Evans <bde@FreeBSD.org>
Tue, 24 Jul 2018 10:10:16 +0000 (10:10 +0000)
committerBruce Evans <bde@FreeBSD.org>
Tue, 24 Jul 2018 10:10:16 +0000 (10:10 +0000)
commitdaa1e391104cea6c63abbb3f1b2b6785f4c986fa
treee557ce100179d112b2247aae6d129809c89728df
parentf9027e3a3aa6a7704d9882159c39b75ffb2e2e03
Fix the conversion to use nan_mix() in r336362.  fmod*(x, y),
remainder*(x, y) and remquo*(x, y, quo) were broken for y = 0 by changing
multiplication by y to addition of y.  (When y is 0, the result should be
NaN but became 1 for finite x.)

Use a new macro nan_mix_op() to give more control over the mixing, and
expand comments.

Recent re-testing missed finding this bug since I only tested the macro
version on amd64 and i386 and these arches don't use the C versions (they
use either asm versions or builtins).

Reported by: enh via freebsd-numerics
lib/msun/src/e_fmod.c
lib/msun/src/e_fmodf.c
lib/msun/src/e_fmodl.c
lib/msun/src/e_remainder.c
lib/msun/src/e_remainderf.c
lib/msun/src/math_private.h
lib/msun/src/s_remquo.c
lib/msun/src/s_remquof.c
lib/msun/src/s_remquol.c