From a985cadd390dc83e2be80ce22961ff6da5e6feb5 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 1 Sep 2014 09:55:23 -0400 Subject: 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. --- perlvars.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'perlvars.h') 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 . + * 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 + * + * The division by zero might warn with some compilers. */ +PERLVARIC(G, nan, NV, (NV)0.0/0.0) -- cgit v1.2.1