bugGNU Octave - Bugs: bug #58908, same non-zero output becomes zero...

 
 

bug #58908: same non-zero output becomes zero suddenly

Submitter:  rambiz khalili <rambiz>
Submitted:  Fri 07 Aug 2020 04:04:33 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 09 Aug 2020 01:23:04 PM UTC, comment #3: 

Please close as Invalid. This is not a bug, nor is it Octave-specific behaviour.

Anonymous
Fri 07 Aug 2020 05:08:06 PM UTC, comment #2: 

@OP: Read "What Every Computer Scientist Should Know About Floating-Point Arithmetic" by David Goldberg.

Anonymous
Fri 07 Aug 2020 05:32:20 AM UTC, comment #1: 

I think this is just the limitation given by the accuracy that is provided by the double format. AFAIK, this 64 bit long number representation has 55 digits mantissa. Taking into account that 10 binary digits represent numbers up to approximately 3 decimal digits, then the numbers in your second example are near to the available precision.

Torsten Lilge <ttl>
Group Member
Fri 07 Aug 2020 04:04:33 AM UTC, original submission:  

Hi all,
x-y is the same number, what happens here?

>> x=2.0000000000000011;
>> y=2.0000000000000012;
>> a=1/(x-y)/(x+y)

a = -562949953421311.8

>> b=1/(x^2-y^2)

b = -562949953421312

>> x=2.0000000000000111;
>> y=2.0000000000000112;
>> a=1/(x-y)/(x+y)

warning: division by zero
a =  Inf

>> b=1/(x^2-y^2)

warning: division by zero
b =  Inf

>> x-y

ans = 0

>> x^2-y^2

ans = 0

rambiz khalili <rambiz>

 

(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 ttl (Posted a comment)
  • -email is unavailable- added by rambiz (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 group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-09 ttl StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code