bugMIT/GNU Scheme - Bugs: bug #27513, Gambit's arithmetic puts us to...

 
 

bug #27513: Gambit's arithmetic puts us to shame

Submitter:  Taylor R. Campbell <riastradh>
Submitted:  Thu 24 Sep 2009 05:20:59 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Suboptimal behavior
Status:  None Privacy:  Public
Assigned to:  riastradh Originator Name: 
Open/Closed:  Open
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 24 Sep 2009 05:20:59 AM UTC, original submission:  

(expt 27 2/3)
;Value: 8.999999999999998

(expt (expt 2 2000) 3/2000)
;The object 114813069527425452423283320117768198402231770208869520047764273682576626139237031385665948631650626991844596463898746277344711896086305533142593135616665318539129989145312280000688779148240044871428926990063486244781615463646388363947317026040466353970904996558162398808944629605623311649536164221970332681344168908984458505602379484807914058900934776500429002716706625830522008132236281291761267883317206598995396418127021779858404042159853183251540889433902091920554957783589672039160081957216630582755380425583726015528348786419432054508915275783882625175435528800822842770817965453762184851149029376, passed as the first argument to integer->flonum, is not in the correct range.

(integer-shift-left (expt 2 50) -1)
;Hardware trap SIGBUS

Gambit gives:

> (expt 27 2/3)

9

> (expt (expt 2 2000) 3/2000)

8

> (arithmetic-shift (expt 2 50) -1)

562949953421312

Taylor R. Campbell <riastradh>
Group Member

 

(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 riastradh (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.14-8eb0.
    Corresponding source code