bugGNU Octave - Bugs: bug #63760, Simple arithmetic error. When...

 
 

bug #63760: Simple arithmetic error. When Subtracting a number from another, creates incorrect result

Submitter:  None
Submitted:  Sun 05 Feb 2023 07:43:11 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Ryan Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 7.3.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 05 Feb 2023 12:28:18 PM UTC, comment #2: 

Floating point rounding, not Octave-specific and not a bug.

Use

movfun (@(x) mean(x), data, wlen)

instead of writing a loop.

Arun Giridhar <arungiridhar>
Group Member
Sun 05 Feb 2023 07:51:05 AM UTC, comment #1: 

[Accidentally posted twice...unable to remove my bug request]

Ryan F <rfleming>
Sun 05 Feb 2023 07:43:11 AM UTC, original submission:  

I have attached a general script to replicate the issue.

It seems when I create these arrays, assign the data and then try to process it, it results in incorrect arithmetic. Looking at the variables:
a = array(1) = 3729.6
b = array(2) = 3729.4
a-c results in 0.1158 instead of the target 0.2

If these variables are assigned directly and the math attempted, it works fine. It only appears to occur when ran with the various data processing I have done within the file.

Anonymous

 

(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 arungiridhar (Posted a comment)
  • -email is unavailable- added by rfleming (Posted a comment)
  •  

    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
    2023-02-05 arungiridhar StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-0329.
    Corresponding source code