[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #37880] Make factor to not show wrong answers
From: |
Doug Stewart |
Subject: |
[Octave-bug-tracker] [bug #37880] Make factor to not show wrong answers for large numbers |
Date: |
Mon, 30 Sep 2013 15:13:39 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36 |
Follow-up Comment #2, bug #37880 (project octave):
See bug #37830
octave-3.2.4:1> bitmax
ans = 9.0072e+15
octave-3.2.4:2> factor(bitmax)
ans =
6361 69431 20394401
octave-3.2.4:3> prod(ans)
ans = 9.0072e+15
octave-3.2.4:4> factor(bitmax+1)
ans =
Columns 1 through 20:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
Columns 21 through 40:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Columns 41 through 53:
2 2 2 2 2 2 2 2 2 2 2 2 2
octave-3.2.4:5> prod(ans)
ans = 9.0072e+15
octave-3.2.4:6> factor(bitmax+2)
ans =
Columns 1 through 20:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
Columns 21 through 40:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
Columns 41 through 53:
2 2 2 2 2 2 2 2 2 2 2 2 2
octave-3.2.4:7> prod(ans)
ans = 9.0072e+15
octave-3.2.4:6> factor(bitmax+2)
ans =
Columns 1 through 20:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
Columns 21 through 40:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2
Columns 41 through 53:
2 2 2 2 2 2 2 2 2 2 2 2 2
octave-3.2.4:7> prod(ans)
ans = 9.0072e+15
octave-3.2.4:8> factor(bitmax+200)
ans =
2.0000e+00 2.0000e+00 2.0000e+00 8.9000e+01 6.9490e+03
1.8205e+09
octave-3.2.4:9> prod(ans)
ans = 9.0072e+15
octave-3.2.4:10> factor(bitmax+20011)
ans =
2 71 107 919 645063007
octave-3.2.4:11> prod(ans)
ans = 9.0072e+15
I don't know what matlab does.
I understand that the user should not ask such a question, but they do.
So what should we do when they do ask?
I think we should worn them, and this is what the patch does.
Doug
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?37880>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/