[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 |
URL:
<https://savannah.gnu.org/bugs/?55238>
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
_______________________________________________________
Details:
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
<http://savannah.gnu.org/bugs/download.php?file_id=45686>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55238>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0,
anonymous <=
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, anonymous, 2018/12/17
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Michael Leitner, 2018/12/18
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Michael Leitner, 2018/12/18
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, anonymous, 2018/12/18
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Mike Miller, 2018/12/18
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Rik, 2018/12/21
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Michael Leitner, 2018/12/22
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Rik, 2018/12/23
- [Octave-bug-tracker] [bug #55238] Modulo [mod(X, Y)] of larger values seems to fail silently to output 0, Rik, 2018/12/23