From b68c599a1231c4d11ec0b0a667ce0c407c357eab Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 23 Jan 2008 09:18:41 +0000 Subject: Fix the misplaced warnings and failing tests caused by the precision loss warning on ++ and -- by moving the check to Configure time, creating a new config.sh variable nv_overflows_integers_at which contains an constant expression for the value of the NV which can't be incremented by 1.0 p4raw-id: //depot/perl@33049 --- Porting/Glossary | 5 +++++ Porting/config.sh | 1 + Porting/config_H | 7 +++++++ 3 files changed, 13 insertions(+) (limited to 'Porting') diff --git a/Porting/Glossary b/Porting/Glossary index a457ed5b32..42d75a14ef 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -3799,6 +3799,11 @@ nv_preserves_uv_bits (perlxv.U): This variable indicates how many of bits type uvtype a variable nvtype can preserve. +nv_overflows_integers_at (perlxv.U): + This variable gives the largest integer value that NVs can hold + as a constant floating point expression. + If it could not be determined, it holds the value 0. + nveformat (perlxvf.U): This variable contains the format string used for printing a Perl NV using %e-ish floating point format. diff --git a/Porting/config.sh b/Porting/config.sh index b20a656f6f..eb9ab0192a 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -824,6 +824,7 @@ nroff='nroff' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' +nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0' nv_preserves_uv_bits='53' nveformat='"e"' nvfformat='"f"' diff --git a/Porting/config_H b/Porting/config_H index 2540a14d8e..f74dc6714d 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -4271,6 +4271,12 @@ * This symbol contains the number of bits a variable of type NVTYPE * can preserve of a variable of type UVTYPE. */ +/* NV_OVERFLOWS_INTEGERS_AT + * This symbol gives the largest integer value that NVs can hold. This + * value + 1.0 cannot be stored accurately. It is expressed as constant + * floating point expression to reduce the chance of decimale/binary + * conversion issues. If it can not be determined, the value 0 is given. + */ /* NV_ZERO_IS_ALLBITS_ZERO: * This symbol, if defined, indicates that a variable of type NVTYPE * stores 0.0 in memory as all bits zero. @@ -4303,6 +4309,7 @@ #define NVSIZE 8 /**/ #undef NV_PRESERVES_UV #define NV_PRESERVES_UV_BITS 53 +#define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0 #define NV_ZERO_IS_ALLBITS_ZERO #if UVSIZE == 8 # ifdef BYTEORDER -- cgit v1.2.1