bugGNU Octave - Bugs: bug #35680, mod does not warn when losing...

 
 

bug #35680: mod does not warn when losing precision

Submitter:  None
Submitted:  Thu 01 Mar 2012 04:21:20 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Dec 2015 04:37:13 PM UTC, comment #2: 

Closing as won't fix, Octave is working as expected with numerical values with limited precision.

The symbolic package is now fully functional, so if you want arbitrary precision the vpa class takes care of this type of problem:


>> y = 98 - mod (60392010507000000, 97)
y =  50
>> y = 98 - mod (vpa (60392010507000000), 97)
y = (sym) 47.000000000000000000000000000000


Mike Miller <mtmiller>
Group Member
Thu 01 Mar 2012 04:32:14 PM UTC, comment #1: 

This essentially the same as bug #32924. I'm marking it as a duplicate.

I'm also lowering the priority. Octave is not a CAS and integers have limited precision.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 01 Mar 2012 04:21:20 PM UTC, original submission:  

I've found an error when computing mod97.

FORMULA: 98 - mod(data, 97)

EXAMPLE: 98 - mod(60392010507000000, 97)
OCTAVE ANSWER: 50

But it should be 47, not 50! overflow?

I think the mod() formula should launch a warning or something else to indicate problem.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jordigh (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-20 mtmiller Dependencies- patch #9875 is dependent
    2015-12-22 mtmiller StatusDuplicate Wont Fix
        Open/ClosedOpen Closed
    2012-03-01 rik5 Carbon-CopyRemoved 72865 -
    2012-03-01 rik5 Priority5 - Normal 3 - Low
    2012-03-01 jordigh Operating SystemMicrosoft Windows Any
    2012-03-01 jordigh Severity3 - Normal 2 - Minor
        StatusNone Duplicate
        Summarymod97 incorrect result mod does not warn when losing precision
    2012-03-01 jordigh Dependencies- Depends on bugs #32924

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code