zdiv.3 - libzahl - big integer library
(HTM) git clone git://git.suckless.org/libzahl
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
zdiv.3 (869B)
---
1 .TH ZDIV 3 libzahl
2 .SH NAME
3 zdiv - Calculate the quotient of two big integer
4 .SH SYNOPSIS
5 .nf
6 #include <zahl.h>
7
8 void zdiv(z_t \fIquotient\fP, z_t \fIdividend\fP, z_t \fIdivisor\fP);
9 .fi
10 .SH DESCRIPTION
11 .B zdiv
12 calculates the truncated quotient of a
13 .I dividend
14 and a
15 .IR divisor ,
16 and stores the result in
17 .IR quotient .
18 That is,
19 .I quotient
20 gets
21 .I dividend
22 /
23 .IR divisor .
24 .P
25 It is safe to call
26 .B zdiv
27 with non-unique parameters.
28 .SH RATIONALE
29 .B zdiv
30 rounds toward zero because this is what you expect
31 from the C programming language and is most often
32 what you want to do when rounding downwards. Note
33 however, this is not the same things as floored
34 division which is used in some programming languages
35 and some libraries.
36 .SH SEE ALSO
37 .BR zdivmod (3),
38 .BR zstr (3),
39 .BR zadd (3),
40 .BR zsub (3),
41 .BR zmul (3),
42 .BR zmod (3),
43 .BR zneg (3),
44 .BR zabs (3),
45 .BR zpow (3)