Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate a Mod b in Casio fx-991ES calculator

Tags:

calculator

Does anyone know how to calculate a Mod b in Casio fx-991ES Calculator. Thanks

like image 250
user1035927 Avatar asked Dec 07 '11 17:12

user1035927


People also ask

Is there a mod button on calculator?

Modulo Calculator Modulo is frequently expressed as a mod b; however, in some cases, it can be expressed as a % b. On calculators, modulo is often calculated using the mod() function: mod(a, b) = r.


2 Answers

This calculator does not have any modulo function. However there is quite simple way how to compute modulo using display mode ab/c (instead of traditional d/c).

How to switch display mode to ab/c:

  • Go to settings (Shift + Mode).
  • Press arrow down (to view more settings).
  • Select ab/c (number 1).

Now do your calculation (in comp mode), like 50 / 3 and you will see 16 2/3, thus, mod is 2. Or try 54 / 7 which is 7 5/7 (mod is 5). If you don't see any fraction then the mod is 0 like 50 / 5 = 10 (mod is 0).

The remainder fraction is shown in reduced form, so 60 / 8 will result in 7 1/2. Remainder is 1/2 which is 4/8 so mod is 4.

EDIT: As @lawal correctly pointed out, this method is a little bit tricky for negative numbers because the sign of the result would be negative.

For example -121 / 26 = -4 17/26, thus, mod is -17 which is +9 in mod 26. Alternatively you can add the modulo base to the computation for negative numbers: -121 / 26 + 26 = 21 9/26 (mod is 9).

EDIT2: As @simpatico pointed out, this method will not work for numbers that are out of calculator's precision. If you want to compute say 200^5 mod 391 then some tricks from algebra are needed. For example, using rule (A * B) mod C = ((A mod C) * B) mod C we can write:

200^5 mod 391 = (200^3 * 200^2) mod 391 = ((200^3 mod 391) * 200^2) mod 391 = 98

like image 173
NightElfik Avatar answered Sep 20 '22 05:09

NightElfik


As far as I know, that calculator does not offer mod functions. You can however computer it by hand in a fairly straightforward manner. Ex.

(1)50 mod 3

(2)50/3 = 16.66666667

(3)16.66666667 - 16 = 0.66666667

(4)0.66666667 * 3 = 2

Therefore 50 mod 3 = 2

Things to Note: On line 3, we got the "minus 16" by looking at the result from line (2) and ignoring everything after the decimal. The 3 in line (4) is the same 3 from line (1).

Hope that Helped.

Edit As a result of some trials you may get x.99991 which you will then round up to the number x+1.

like image 36
Modulator Avatar answered Sep 17 '22 05:09

Modulator