Release calc version 2.10.3t5.45

This commit is contained in:
Landon Curt Noll
1997-10-04 20:06:29 -07:00
parent 4618313a82
commit 6e10e97592
300 changed files with 38279 additions and 8584 deletions

43
help/hnrmod Normal file
View File

@@ -0,0 +1,43 @@
NAME
hnrmod - compute mod h * 2^n +r
SYNOPSIS
hnrmod(v, h, n, r)
TYPES
v integer
h integer
n integer
r integer
return integer
DESCRIPTION
Compute the value:
v % (h * 2^n +r)
where:
h > 0
n > 0
r == -1, 0 or 1
This builtin in faster than the standard mod in that is makes use
of shifts and additions when h == 1. When h > 1, a division by h
is also needed.
EXAMPLE
> print hnrmod(2^177-1, 1, 177, -1), hnrmod(10^40, 17, 51, 1)
0 33827019788296445
LIMITS
h > 0
2^31 > n > 0
r == -1, 0 or 1
LIBRARY
void zhnrmod(ZVALUE v, ZVALUE h, ZVALUE zn, ZVALUE zr, ZVALUE *res)
SEE ALSO
mod