develooper Front page | perl.perl5.porters | Postings from November 2000

[PATCH] Is infinity a number?

Thread Next
From:
Simon Cozens
Date:
November 29, 2000 06:48
Subject:
[PATCH] Is infinity a number?
Message ID:
20001129144820.A31339@pembro33.pmb.ox.ac.uk
 perl -we 'print 0+"infinity"'
tells me that:
 Argument "infinity" isn't numeric in addition (+) at -e line 1.
But then it treats it like a number, instead of zero:
 inf

I believe that this warning is spurious.

--- sv.c~	Wed Nov 29 14:33:59 2000
+++ sv.c	Wed Nov 29 14:45:50 2000
@@ -2038,7 +2038,7 @@
     }
     while (isSPACE(*s))
 	s++;
-    if (s >= send)
+    if (s >= send || sawinf)
 	return numtype;
     if (len == 10 && memEQ(sbegin, "0 but true", 10))
 	return IS_NUMBER_TO_INT_BY_ATOL;

-- 
Familiarity breeds facility.
        -- Megahal (trained on asr), 1998-11-06

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About