mod problems with big numbers

3 views
Skip to first unread message

pepebot

unread,
Oct 28, 2005, 8:43:46 AM10/28/05
to
i'm trying the following calculation (97^53) mod 299, the result given
by my calculator, a 49g+; is 145. the result i should get is 80.
I know the correct result to be 80. i try to do this on a coworker 49g
and it gives a result of 80. i also tried on the hp48, and the result
is 145.
can anybody explain me why only the 49g gives me the desired result? is
this a bug of the 48 and 49g+ mod function?

Brother-Peter

unread,
Oct 28, 2005, 8:54:14 AM10/28/05
to
I get the correct result on my 49g+
Please check your input once more

"pepebot" <pp1...@yahoo.com> wrote in message
news:1130503426....@g49g2000cwa.googlegroups.com...

amspire

unread,
Oct 28, 2005, 11:08:02 AM10/28/05
to

I have two HP49G. One was returning 80, the other was returning 145.

The one returning 145 was converting the number onto a floating point
number rather then a large integer. So the 145 is due to the truncated
precision of floats.

So what causes the HP49 series to want to convert huge integers into
flaoting point?

The main criminals are flag3 :

Function-> Num (set) and
Function -> Symb (not set).

and Flag 105:

Approximate Mode ON (set)
Approximate mode Off (not set)

Most of the time, clearing flags 3 and 105 will get the calculator
working correctly with the large integers. However, sometimes the
calculator gets "stuck' and changing the flags doesn't help. - it
converts 97^53 to a float no matter what you do!

I am still trying to make sense of it.

What I have wirked out it that if Flag 3 is set, the HP49G regards the
Y^X button as a function and so in converts 97 and 53 to floats
before calculating 97^53.

If you multiple 97 by itself 53 times, you will get the correct answer
regardless of flag3 (since there were no functions involved).

If approximate mode is ON (flag 105), then every number entered is
immediately converted to flaoting point.

pepebot

unread,
Oct 28, 2005, 11:49:43 AM10/28/05
to
thanks a lot. i check the flags you suggested. after clearing them, i
have obtained the correct result.

Brother-Peter

unread,
Oct 28, 2005, 1:40:29 PM10/28/05
to
"pepebot" <pp1...@yahoo.com> wrote in message
news:1130514583.9...@g47g2000cwa.googlegroups.com...

> thanks a lot. i check the flags you suggested. after clearing them, i
> have obtained the correct result.

Now I suddenly remember that there is a floating point library
for extremely long floats, DIGITS can be set to 100 or even 1000
The processing takes long, but you can use non-integers
www.hpcalc.org
Search for...was it:
LongFloat


Reply all
Reply to author
Forward
0 new messages