mod problems with big numbers

Skip to first unread message


Oct 28, 2005, 8:43:46 AM10/28/05
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?


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

"pepebot" <> wrote in message


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

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.


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


Oct 28, 2005, 1:40:29 PM10/28/05
"pepebot" <> wrote in message

> 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
Search for...was it:

Reply all
Reply to author
0 new messages