Integer Modes - 4: Integer Arithmetic - HP RPN SCIENTIFIC WP 34S Owner's Manual

Table of Contents

Advertisement

Integer Modes – 4:
Of the four basic arithmetic operations ( +, -, ×, and / ), the first three work in integer
modes as they do in DECM, but with up to 64 digits precision in binary mode. Look at +/-
like a multiplication times -1, and at y
input parameters and the mode settings, the overflow or carry flags will be set in such an
operation (see the end of this section).
Divisions, however, must be handled differently in integer modes since the result cannot
feature a fractional part here. Generally, the formula
applies, with the horizontal bar denoting real division,
rmdr
standing for the remainder of the latter. While remainders for positive parameters are
simply found, remainders for negative dividends or divisors lead to confusion sometimes.
The formula above, however, is easily employed for calculating such remainders (also for
real numbers – see the first line of this example):
Examples:
In general,
Unfortunately, there is a second function doing almost the same: it is called
With the same pairs of numbers as above, it returns:
mod
So
returns the same as
The general formula for
By the way, this formula applies to real numbers as well. So it may be used straight
forwardly for calculating e.g.
These four functions are called IDIV, RMDR, MOD and FLOOR in your WP 34S for
obvious reasons.
WP 34S Owner's Manual
Integer Arithmetic
x
like a repeated multiplication. Depending on the
,
,
,
.
rmdr
if both parameters have equal signs only.
mod
is a bit more sophisticated than the one above:
with e.g.
Edition 3.1
div
representing integer division, and
(and for a real case:
.
and
)
mod
.
.
-
.
Page 58 of 211

Advertisement

Table of Contents
loading

Table of Contents