diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-09-01 09:55:23 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-09-01 14:11:56 -0400 |
commit | a985cadd390dc83e2be80ce22961ff6da5e6feb5 (patch) | |
tree | e6a1ebad3d9c92411ca37325c382939844d995fc /perlvars.h | |
parent | c0cd65b2410a7d7f64d2d3336de4f12861b430b2 (diff) | |
download | perl-a985cadd390dc83e2be80ce22961ff6da5e6feb5.tar.gz |
Do not use HUGE_VAL/VALL for NV_INF.
Because some platforms (like HP-UX 10.*) have HUGE_VAL as DBL_MAX,
which, while large, is not quite the infinity. So have infinity
own our very own.
Similarly for NV_NAN.
Diffstat (limited to 'perlvars.h')
-rw-r--r-- | perlvars.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/perlvars.h b/perlvars.h index 7bafa40882..40f5072b35 100644 --- a/perlvars.h +++ b/perlvars.h @@ -237,3 +237,16 @@ PERLVAR(G, malloc_mutex, perl_mutex) /* Mutex for malloc */ PERLVARI(G, hash_seed_set, bool, FALSE) /* perl.c */ PERLVARA(G, hash_seed, PERL_HASH_SEED_BYTES, unsigned char) /* perl.c and hv.h */ + +/* The infinity. Used if no suitable definition is found in <math.h>. + * Note: many older places (like HP-UX 10.X) define HUGE_VAL + * as DBL_MAX (or LDBL_MAX for long doubles). Therefore HUGE_VAL + * is not a suitable replacement for infinity. + * + * The division by zero might warn with some compilers. */ +PERLVARIC(G, infinity, NV, (NV)1.0/0.0) + +/* The not-a-number. Used if no suitable definition is found in <math.h> + * + * The division by zero might warn with some compilers. */ +PERLVARIC(G, nan, NV, (NV)0.0/0.0) |