summaryrefslogtreecommitdiff
path: root/man3/remquo.3
blob: 7cf0efb04239cae4d1befb32d2e14eb7b03e9a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\" based on glibc infopages
.\" polished, aeb
.TH REMQUO 3 2007-07-26 "GNU" "Linux Programmer's Manual"
.SH NAME
remquo, remquof, remquol \- remainder and part of quotient
.SH SYNOPSIS
.nf
.B #include <math.h>
.sp
.BI "double remquo(double " x ", double " y ", int *" quo );
.br
.BI "float remquof(float " x ", float " y ", int *" quo );
.br
.BI "long double remquol(long double " x ", long double " y ", int *" quo );
.fi
.sp
Link with \fI\-lm\fP.
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.sp
.ad l
.BR remquo (),
.BR remquof (),
.BR remquol ():
_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
.I cc\ -std=c99
.ad b
.SH DESCRIPTION
These functions compute the remainder and part of the quotient
upon division of
.I x
by
.IR y .
A few bits of the quotient are stored via the
.I quo
pointer.
The remainder is returned as function value.

The value of the remainder is the same as that computed by the
.BR remainder (3)
function.

The value stored via the
.I quo
pointer has the sign of
.IR x / y
and agrees with the quotient in at least the low order 3 bits.

For example, remquo(29.0,3.0) returns \-1.0 and might store 2.
Note that the actual quotient might not fit in an integer.
.\" A possible application of this function might be the computation
.\" of sin(x). Compute remquo(x, pi/2, &quo) or so.
.\"
.\" glibc, UnixWare: return 3 bits
.\" MacOS 10: return 7 bits
.SH "CONFORMING TO"
C99
.SH "SEE ALSO"
.BR fmod (3),
.BR logb (3),
.BR remainder (3)