#define PL_Ghash_seed_set (my_vars->Ghash_seed_set)
#define PL_hints_mutex (my_vars->Ghints_mutex)
#define PL_Ghints_mutex (my_vars->Ghints_mutex)
+#define PL_infinity (my_vars->Ginfinity)
+#define PL_Ginfinity (my_vars->Ginfinity)
#define PL_keyword_plugin (my_vars->Gkeyword_plugin)
#define PL_Gkeyword_plugin (my_vars->Gkeyword_plugin)
#define PL_malloc_mutex (my_vars->Gmalloc_mutex)
#define PL_Gmy_ctx_mutex (my_vars->Gmy_ctx_mutex)
#define PL_my_cxt_index (my_vars->Gmy_cxt_index)
#define PL_Gmy_cxt_index (my_vars->Gmy_cxt_index)
+#define PL_nan (my_vars->Gnan)
+#define PL_Gnan (my_vars->Gnan)
#define PL_op_mutex (my_vars->Gop_mutex)
#define PL_Gop_mutex (my_vars->Gop_mutex)
#define PL_op_seq (my_vars->Gop_seq)
#if !defined(NV_INF) && defined(INF)
# define NV_INF (NV)INF
#endif
-#if !defined(NV_INF) && defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)
-# define NV_INF (NV)HUGE_VALL
-#endif
-#if !defined(NV_INF) && defined(HUGE_VAL)
-# define NV_INF (NV)HUGE_VAL
+#if !defined(NV_INF)
+# define NV_INF (NV)PL_infinity
#endif
#if !defined(NV_NAN) && defined(USE_LONG_DOUBLE)
#if !defined(NV_NAN) && defined(QNAN)
# define NV_NAN (NV)QNAN
#endif
-#if !defined(NV_NAN) && defined(SNAN)
-# define NV_NAN (NV)SNAN
-#endif
#if !defined(NV_NAN) && defined(NAN)
# define NV_NAN (NV)NAN
#endif
+#if !defined(NV_NAN) && defined(SNAN)
+# define NV_NAN (NV)SNAN
+#endif
#if !defined(NV_NAN) && defined(NV_INF)
-# define NV_NAN (NV_INF-NV_INF)
+# define NV_NAN PL_nan
#endif
#ifndef __cplusplus
#define PL_hash_seed_set (*Perl_Ghash_seed_set_ptr(NULL))
#undef PL_hints_mutex
#define PL_hints_mutex (*Perl_Ghints_mutex_ptr(NULL))
+#undef PL_infinity
+#define PL_infinity (*Perl_Ginfinity_ptr(NULL))
#undef PL_keyword_plugin
#define PL_keyword_plugin (*Perl_Gkeyword_plugin_ptr(NULL))
#undef PL_malloc_mutex
#define PL_my_ctx_mutex (*Perl_Gmy_ctx_mutex_ptr(NULL))
#undef PL_my_cxt_index
#define PL_my_cxt_index (*Perl_Gmy_cxt_index_ptr(NULL))
+#undef PL_nan
+#define PL_nan (*Perl_Gnan_ptr(NULL))
#undef PL_op_mutex
#define PL_op_mutex (*Perl_Gop_mutex_ptr(NULL))
#undef PL_op_seq
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)