hp40g+.book Page 48 Friday, December 9, 2005 1:03 AM

IDIV2

In step-by-step mode, there are a number of intermediate results:

18 mod 15 = 3

15 mod 3 = 0

Result: 3

Pressing or then causes 3 to be written to the Equation Writer.

Note that the last non-zero remainder in the sequence of remainders shown in the intermediate steps is the GCD.

Returns the quotient and the remainder of the Euclidean division between two integers.

Example

Typing:

IDIV2(148, 5)

gives:

29 AND 3

In step-by-step mode, the calculator shows the division process in longhand.

IEGCD

Returns the value of Bézout’s Identity for two integers. For example, IEGCD(A,B) returns U AND V = D, with U, V, D such that AU+BV=D and D=GCD(A,B).

Example

Typing:

IEGCD(48, 30)

gives

2 AND –3 = 6

In other words: 2·48 + (–3)·30 = 6 and GCD(48,30) = 6.

In step-by-step mode, we get:

[z,u,v]:z=u*48+v*30

14-48

 

 

Computer Algebra System (CAS)