summaryrefslogtreecommitdiff
path: root/man3/remquo.3
blob: 53366bf0433f8c4daacbd3fff825638280ef5aaa (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
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\" based on glibc infopages
.\" polished, aeb
.TH REMQUO 3 2002-08-10 "GNU" "Linux Programmer's Manual"
.SH NAME
remquo, remquof, remquol \- remainder and part of quotient
.SH SYNOPSIS
.nf
#define _ISOC99_SOURCE
.br
.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
.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),
.BR feature_test_macros (7)