Initial revision
[LeanCalc.git] / help / quomod
1 NAME
2     quomod - assign quotient and remainder to two variables
3
4 SYNOPSIS
5     quomod(x, y, q, r)
6
7 TYPES
8     x           real
9     y           real
10     q           any
11     r           any
12
13     return      real
14
15 DESCRIPTION
16     Returns 0 or 1 according as x is or is not a multiple of y.
17     Let  x = q * y + r  where q is an integer and 0 <= r < y
18     This function assigns the values q and r to the variables
19     Q and R.  If x >= 0, the results for Q and R are the same as
20     those given by Q = x // y, R = x % y.
21
22     XXX - need to document relationship with "quomod" config value
23
24 EXAMPLE
25     > global u, v;
26     > global mat M[2];
27     > print quomod(13,5,u,v), u, v, quomod(15.6,5.2,M[0],M[1]), M[0], M[1];
28     > 1 2 3 0 3 0
29     > A = assoc();
30     > print quomod(13, 5, A[1], A[2]), A[1], A[2]
31     > 1 2 3
32
33     XXX - need examples of how the "quomod" config file changes results
34
35 LIMITS
36     y > 0
37
38 LINK LIBRARY
39     BOOL qquomod(NUMBER *q1, NUMBER *q2, NUMBER **retqdiv, NUMBER **retqmod)
40
41 SEE ALSO
42     //,  %
43