summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDan Sugalski <dan@sidhe.org>1999-06-08 07:09:38 -0700
committerGurusamy Sarathy <gsar@cpan.org>1999-07-06 07:00:01 +0000
commit6520202708b2a849ca8538ed88e0f75376c3b2d7 (patch)
tree543627af324c7f4ae271b4f2df1abe73fd0ef55e /util.c
parent626727d5e2c1f691a308ce30d70cf3d5998f4c53 (diff)
downloadperl-6520202708b2a849ca8538ed88e0f75376c3b2d7.tar.gz
slightly tweaked version of suggested patch
Message-Id: <3.0.6.32.19990608140938.030f12e0@ous.edu> Subject: [PATCH 5.005_57]Use NV instead of double in the core p4raw-id: //depot/perl@3602
Diffstat (limited to 'util.c')
-rw-r--r--util.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/util.c b/util.c
index 3655cefada..99415f0918 100644
--- a/util.c
+++ b/util.c
@@ -2630,7 +2630,7 @@ Perl_repeatcpy(pTHX_ register char *to, register const char *from, I32 len, regi
}
U32
-Perl_cast_ulong(pTHX_ double f)
+Perl_cast_ulong(pTHX_ NV f)
{
long along;
@@ -2667,7 +2667,7 @@ Perl_cast_ulong(pTHX_ double f)
#endif
I32
-Perl_cast_i32(pTHX_ double f)
+Perl_cast_i32(pTHX_ NV f)
{
if (f >= I32_MAX)
return (I32) I32_MAX;
@@ -2677,12 +2677,12 @@ Perl_cast_i32(pTHX_ double f)
}
IV
-Perl_cast_iv(pTHX_ double f)
+Perl_cast_iv(pTHX_ NV f)
{
if (f >= IV_MAX) {
UV uv;
- if (f >= (double)UV_MAX)
+ if (f >= (NV)UV_MAX)
return (IV) UV_MAX;
uv = (UV) f;
return (IV)uv;
@@ -2693,7 +2693,7 @@ Perl_cast_iv(pTHX_ double f)
}
UV
-Perl_cast_uv(pTHX_ double f)
+Perl_cast_uv(pTHX_ NV f)
{
if (f >= MY_UV_MAX)
return (UV) MY_UV_MAX;
@@ -3303,7 +3303,7 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t)
* So it is in perl for (say) POSIX to use.
* Needed for SunOS with Sun's 'acc' for example.
*/
-double
+NV
Perl_huge(void)
{
return HUGE_VAL;
@@ -3506,22 +3506,23 @@ Perl_my_fflush_all(pTHX)
#endif
}
-double
+NV
Perl_my_atof(pTHX_ const char* s) {
#ifdef USE_LOCALE_NUMERIC
if ((PL_hints & HINT_LOCALE) && PL_numeric_local) {
- double x, y;
+ NV x, y;
- x = atof(s);
+ x = Perl_atof(s);
SET_NUMERIC_STANDARD();
- y = atof(s);
+ y = Perl_atof(s);
SET_NUMERIC_LOCAL();
if ((y < 0.0 && y < x) || (y > 0.0 && y > x))
return y;
return x;
- } else
- return atof(s);
+ }
+ else
+ return Perl_atof(s);
#else
- return atof(s);
+ return Perl_atof(s);
#endif
}