bugGNU Octave - Bugs: bug #51952, Incorrect result for computation of

 
 

bug #51952: Incorrect result for computation of

Submitted by:  None
Submitted on:  Wed 06 Sep 2017 02:29:36 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Pocholo BoladoOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 06 Sep 2017 03:47:48 PM UTC, comment #1:

You cannot expect it in floating point arithmetic. Even the simpler

does not give exactly 0. Please, look for "What Every Computer Scientist Should Know About Floating-Point Arithmetic"

Marco Caliari <caliari>
Project Member
Wed 06 Sep 2017 02:29:36 PM UTC, original submission:

For computation with imaginary
Let a = 1 angle 120 degrees

a = (cosd(120) + ((sind(120)*i)))
a = -0.50000 + 0.86603i

(a^2) + a + 1
ans = 0.0000e+000 + 3.3307e-016i

1 + a + (a^2)
ans = -1.1102e-016 + 3.3307e-016i

a + 1 + (a^2)
ans = -1.1102e-016 + 3.3307e-016i

I thought it would give me same answers of 0 + 0i?

Thank you, I am using windows 10 OS.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by caliari (Posted a comment)
  •  

    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 project members can vote.

     

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

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 Sep 2017 03:47:48 PM UTCcaliariStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1