diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2016-08-17 21:16:16 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2016-08-17 22:13:38 -0400 |
commit | b28053d1f063cb783e73b0596d1f58a21681fda6 (patch) | |
tree | 140bdff3f4ca75d24f2d62cf64b09ea9ec5d7e84 | |
parent | f40ac91c3b9891b83f3d253861009c290584b646 (diff) | |
download | perl-b28053d1f063cb783e73b0596d1f58a21681fda6.tar.gz |
Define Perl_fp_class() for quadmath
More importantly, define Perl_fp_class_denorm()
so that hexfp subnormals work with printf %a.
-rw-r--r-- | perl.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2022,6 +2022,12 @@ extern long double Perl_my_frexpl(long double x, int *e); # define Perl_isinf(x) isinfq(x) # define Perl_isnan(x) isnanq(x) # define Perl_isfinite(x) !(isnanq(x) || isinfq(x)) +# define Perl_fp_class(x) ((x) == 0.0Q ? 0 : isinfq(x) ? 3 : isnanq(x) ? 4 : PERL_ABS(x) < FLT128_MIN ? 2 : 1) +# define Perl_fp_class_inf(x) (Perl_fp_class(x) == 3) +# define Perl_fp_class_nan(x) (Perl_fp_class(x) == 4) +# define Perl_fp_class_norm(x) (Perl_fp_class(x) == 1) +# define Perl_fp_class_denorm(x) (Perl_fp_class(x) == 2) +# define Perl_fp_class_zero(x) (Perl_fp_class(x) == 0) #else # define NV_DIG DBL_DIG # ifdef DBL_MANT_DIG |