[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values s

From: anonymous
Subject: [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0
Date: Mon, 17 Dec 2018 20:40:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0


                 Summary: Modulo  [mod(X,Y)] of larger values seems to fail
silently to output 0 
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 18 Dec 2018 01:40:16 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: C. Drew
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: GNU/Linux



Hello!  While attempting a homework assignment, I seem to have stumbled onto a
(potential?) bug with the *mod(X,Y)* command.

Specifically, *mod(17^23,55)* is giving an output of 0, when the result should
be 18.

I have tried assigning the 17^23 value to a variable first, converting/casting
it as a float, double, then applying as *mod(x,55)*, yet... Octave still keeps
returning 0 as the result.

Is there something I need to do to enable large number support, or is this a
true bug?

WORKAROUND:  In the meanwhile, using the property of (a*b)mod n = ((a(mod(n) *
(b(mod(n)) mod n, I have been able to get the result using: 
*mod((mod(17^12,55)*mod(17^11,55)),55)*  = 18  
(but, to stress, even slightly larger numbers fail and give wild answers)

See screenshot for details. I hope this helps. :)


File Attachments:

Date: Tue 18 Dec 2018 01:40:16 AM UTC  Name:
Screenshot_2018-12-17_20-26-14.png  Size: 12KiB   By: None
Attached is a screenshot showing the command window, as an example


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]