1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

Add iszero.

TS 18661-1 adds an iszero classification macro to <math.h>.  This
patch implements it for glibc.  There are no new underlying functions
in libm because the implementation uses fpclassify when sNaN support
is required and a direct comparison otherwise; any optimizations for
this macro should be done through adding __builtin_iszero in GCC and
using it in the header for suitable GCC versions, not through adding
other optimized inline or out-of-line versions to glibc.

Tested for x86_64 and x86.

	* math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iszero): New
	macro.
	* math/libm-test.inc (iszero_test_data): New array.
	(iszero_test): New function.
	(main): Call iszero_test.
	* manual/arith.texi (Floating Point Classes): Document iszero.
	* manual/libm-err-tab.pl: Update comment on interfaces without
	ulps tabulated.
This commit is contained in:
Joseph Myers
2016-09-23 21:54:21 +00:00
parent 4775578486
commit bb8081f57f
6 changed files with 55 additions and 3 deletions

View File

@ -78,7 +78,7 @@ use vars qw (%results @all_floats %suffices @all_functions);
"scalbn", "sin", "sincos", "sinh", "sqrt", "tan", "tanh", "tgamma",
"trunc", "y0", "y1", "yn" );
# fpclassify, isnormal, isfinite, isinf, isnan, issignaling,
# issubnormal, signbit, isgreater, isgreaterequal, isless,
# issubnormal, iszero, signbit, isgreater, isgreaterequal, isless,
# islessequal, islessgreater, isunordered are not tabulated.
if ($#ARGV == 0) {