bugAxiom Computer Algebra System - Bugs: bug #4733, Floating point error...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #4733: Floating point error round(-3.77623) etc.

Submitted by:  Bill Page <billpage1>
Submitted on:  Wed 13 Aug 2003 06:22:10 PM UTC  
 
Category: algebraSeverity: 3 - Normal
Item Group: code bugStatus: None
Privacy: PublicAssigned to: Bill Page <billpage1>
Originator Name: Bill PageOpen/Closed: Fix proposed
Release: tenkan & Weiss pre-release GCL-basedReproducibility: Every Time
Fixed Release: 
Error message: 

round(3.77623) => 4
round(-3.77623) => -5 ** wrong!

Example of code trigerring the bug: 

See examples from
http://www.dcs.st-and.ac.uk/~mnd/documentation/axiom_tutorial/

Internal cause: 

Problem seems to happen only with negative floating values.

Tue 14 Oct 2003 09:43:10 PM UTC, comment #2:
[Added information or comment]

This ultimately comes from unexpected behaviour of 'shift' on integers:

shift(-7,-1) is currently -4 (round towards -infinity)

while the code in float.spad expects

shift(-7,-1) to be -3 (round towards 0).

Dylan Thurston <dpt>
Project Administrator
Wed 13 Aug 2003 06:28:11 PM UTC, comment #1:

Similar problems with

truncate(-9.654) => -10 ** wrong!

fractionPart(-3.77623) => 0.22377

Bill Page <billpage1>
Project MemberIn charge of this item.
Wed 13 Aug 2003 06:22:10 PM UTC, original submission:

Expected:

round(3.77623) => 4
round(-3.77623) => -4

Bill Page <billpage1>
Project MemberIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 25 Aug 2004 04:59:17 AM UTCbillpage1Assigned toNone=>billpage1
Wed 15 Oct 2003 04:29:34 AM UTCdptOpen/ClosedOpen=>(Error - Not Found)
Wed 13 Aug 2003 06:28:11 PM UTCbillpage1SummaryFloating point error round(-3.77623)=>
  Example of code trigerring the bug=>
  Internal cause=>
Wed 13 Aug 2003 06:28:10 PM UTCbillpage1ReproducibilityNone=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1