HP Forums

Full Version: a modulo b [solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'd want to obtain a mod b by typing a% b but it doesn't work (syntax error)

[edit] I have to typing a %% b
hello,

The modulo command is MOD and is used as an operator, not a function, hence the syntax is:
9 MOD 4 (returns 1)...

% is for percentages and is a function as in %(5,40) = 2 (40 percent of 5 is 2)...

Cyrille
In CAS mode, n %% m enters a number as a member of an arithmetical ring. Strangely, it gets pretty-printed as %%(n,m) on the left of the display in textbook display mode, but results are always displayed as n' %% m on the right of the display (where n' is the member of the ring congruent to n). Trying to enter the number as %%(n,m) produces a syntax error.
Reference URL's