patchGNU Octave - Patches: patch #9875, Wrong results from the mod()...

 
 

patch #9875: Wrong results from the mod() function for some range of integers

Submitter:  imad elh <imad_elh>
Submitted:  Wed 20 Nov 2019 09:05:02 PM UTC
   
 
Category:  None Priority:  4
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 20 Nov 2019 09:15:40 PM UTC, comment #1: 

Thank you for the example, but this does not look like a patch submission, there is no change proposed or attached.

However, this has already been raised and discussed as a bug report, so I'm closing this as a duplicate of bug #35680.

Octave does not have arbitrary precision, if you want to calculate with arbitrary precision then you might be interested in the symbolic package and the vpa function. With vpa, I get the results that you seem to expect.

Mike Miller <mtmiller>
Group Member
Wed 20 Nov 2019 09:05:02 PM UTC, original submission:  

Hi,
following this simple demostrative process:

>> mod(42^8,4294967295)

ans =  1795713486

>> mod(429^8,4294967295)

ans =  1544028160

>> mod(4294^8,4294967295)

ans = 0

>> mod(42949^8,4294967295)

ans = 0

>> mod(429496^8,4294967295)

ans = 0

>> mod(4294967^8,4294967295)

ans = 0

one could simply see how that mod() function returns zero after its first operand reaches some integer bias value.

imad elh <imad_elh>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by imad_elh (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 logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-20 mtmiller Dependencies- Depends on bugs #35680
    2019-11-20 mtmiller StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code