Tcl Source Code

View Ticket
Login
Ticket UUID: 693877
Title: FreeBSD, expr, "Infinity"
Type: Bug Created on: 2003-02-26 20:28:00
Submitter: nobody Assigned to: kennykb
Subsystem: 47. Bytecode Compiler Severity:
Priority: 5 Medium Last modified: 2005-05-11 02:17:22
Status: Closed Closed by: kennykb
Resolution: Fixed Closed on: 2005-05-10 19:17:22
Version: final: 8.3.5
Description:
From my testing, works on FreeBSD, but not on 
NetBSD.  Tested on 8.3.2, then upgraded to 8.3.5 
(same issue).

-> expr {0?1:"Infinit"}
<- Infinit

-> expr {0?1:"Infinity"}
<- Tcl error: floating-point value too large to represent

It's being messed up by the word 'infinity'?

-----------

OS Platform and Version
 -- FreeBSD 1.6E
 
Problem Behavior
 -- The word 'Infinaty' not liked in expr evaluations?
 
Expected Behavior 
-> expr {0?1:"Infinity"}
<- Infinity

-----------

Carl M. Gregory
http://mc.purehype.net/whois/
User Comments:
mc8 added on 2003-02-27 03:31:19:
Logged In: YES 
user_id=721653

OS Platform and Version 
-- NetBSD 1.6E 

Sorry

dkf added on 2003-02-27 16:54:31:
Logged In: YES 
user_id=79902

Bet this is yet another native strtod() problem.  :^(

dgp added on 2003-02-27 23:47:37:
Logged In: YES 
user_id=80530


Note related change in  Tcl 8.4:

2002-07-22  Donal K. Fellows  <[email protected]>

        * tests/expr.test (expr-22.*): Added tests to help
detect the
        corrected handling.
        * generic/tclExecute.c (IllegalExprOperandType):
Improved error
        message generated when attempting to manipulate Inf
and NaN values.
        * generic/tclParseExpr.c (GetLexeme): Allowed parser
to recognise
        'Inf' as a floating-point number. [Bug 218000]

hobbs added on 2003-04-02 02:10:51:
Logged In: YES 
user_id=72656

Kevin's playing with this now...

kennykb added on 2005-05-11 02:17:21:
Logged In: YES 
user_id=99768

Infinity and NaN are now recognized as floating-point "number"s
on all platforms with IEEE-754 arithmetic.  Infinity does
not cause an error to be thrown, and tests larger than any
finite number.  NaN causes an error to be throws whenever
it arrives in Tcl_GetDoubleFromObj.  It is handled silently
in [binary format] and [binary scan].

"Fixed in 8.5"