bugGNU Common Lisp - Bugs: bug #20992, GCL parses double float incorrectly

 
 

bug #20992: GCL parses double float incorrectly

Submitter:  Robert Dodier <robert_dodier>
Submitted:  Fri 07 Sep 2007 01:46:42 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 21 Nov 2013 05:01:11 PM UTC, comment #2: 

Thanks for your report!  Fixed in latest release, 2.6.10.

Camm Maguire <camm>
Group administrator
Tue 01 Oct 2013 03:31:03 AM UTC, comment #1: 

Not observed in GCL 2.6.9 ANSI on Linux.

For the record, features =>

(:ANSI-CL :COMMON-LISP :COMPILER :NUMLIB :CLOS-CONDITIONS
    :PCL-STRUCTURES :PORTABLE-COMMONLOOPS :PCL :TURBO-CLOSURE-ENV-SIZE
    :TURBO-CLOSURE :SDEBUG :DEFPACKAGE :GNU-LD :XGCL :UNEXEC
    :NATIVE-RELOC :TRUNCATE_USE_C :CLX-LITTLE-ENDIAN :BSD :GNU :LINUX
    :I686 :SGC :IEEE-FLOATING-POINT :UNIX :GMP :GCL :AKCL :COMMON :KCL)

Robert Dodier <robert_dodier>
Fri 07 Sep 2007 01:46:42 AM UTC, original submission:  

GCL parses 4.6e8 incorrectly as the same as 4.6 * 1e8, when it should be the same as 46e7. 46e7 is an integer which can be represented exactly as a double float.

Without looking at the GCL source code, I'm guessing that 4.6e8 is parsed by parsing 4.6 and then parsing the exponent separately.

Some similar examples are parsed correctly, and some aren't.

(eql 4.5e8 45e7)
 => T (OK)

(eql 4.9e8 49e7)
 => NIL (OOPS)

Observed in GCL 2.6.7 on Windows and Linux. It might also be present in 2.6.8 on Windows, not sure about that.

There is some discussion about this in Maxima bug report # 1787111.
http://sourceforge.net/tracker/index.php?func=detail&aid=1787111&group_id=4933&atid=104933

Robert Dodier <robert_dodier>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by camm (Posted a comment)
  • -email is unavailable- added by robert_dodier (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-11-21 camm StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code