Blame man3/remquo.3

Packit 7cfc04
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
Packit 7cfc04
.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
Packit 7cfc04
.\"     <mtk.manpages@gmail.com>
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
Packit 7cfc04
.\" Distributed under GPL
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" based on glibc infopages
Packit 7cfc04
.\" polished, aeb
Packit 7cfc04
.\"
Packit 7cfc04
.TH REMQUO 3 2017-09-15 "GNU" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
remquo, remquof, remquol \- remainder and part of quotient
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <math.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "double remquo(double " x ", double " y ", int *" quo );
Packit 7cfc04
.BI "float remquof(float " x ", float " y ", int *" quo );
Packit 7cfc04
.BI "long double remquol(long double " x ", long double " y ", int *" quo );
Packit 7cfc04
.fi
Packit 7cfc04
.PP
Packit 7cfc04
Link with \fI\-lm\fP.
Packit 7cfc04
.PP
Packit 7cfc04
.in -4n
Packit 7cfc04
Feature Test Macro Requirements for glibc (see
Packit 7cfc04
.BR feature_test_macros (7)):
Packit 7cfc04
.in
Packit 7cfc04
.PP
Packit 7cfc04
.ad l
Packit 7cfc04
.BR remquo (),
Packit 7cfc04
.BR remquof (),
Packit 7cfc04
.BR remquol ():
Packit 7cfc04
.RS 4
Packit 7cfc04
_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
Packit 7cfc04
.RE
Packit 7cfc04
.ad
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
These functions compute the remainder and part of the quotient
Packit 7cfc04
upon division of
Packit 7cfc04
.I x
Packit 7cfc04
by
Packit 7cfc04
.IR y .
Packit 7cfc04
A few bits of the quotient are stored via the
Packit 7cfc04
.I quo
Packit 7cfc04
pointer.
Packit 7cfc04
The remainder is returned as the function result.
Packit 7cfc04
.PP
Packit 7cfc04
The value of the remainder is the same as that computed by the
Packit 7cfc04
.BR remainder (3)
Packit 7cfc04
function.
Packit 7cfc04
.PP
Packit 7cfc04
The value stored via the
Packit 7cfc04
.I quo
Packit 7cfc04
pointer has the sign of
Packit 7cfc04
.IR "x\ /\ y"
Packit 7cfc04
and agrees with the quotient in at least the low order 3 bits.
Packit 7cfc04
.PP
Packit 7cfc04
For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2.
Packit 7cfc04
Note that the actual quotient might not fit in an integer.
Packit 7cfc04
.\" A possible application of this function might be the computation
Packit 7cfc04
.\" of sin(x). Compute remquo(x, pi/2, &quo) or so.
Packit 7cfc04
.\"
Packit 7cfc04
.\" glibc, UnixWare: return 3 bits
Packit 7cfc04
.\" MacOS 10: return 7 bits
Packit 7cfc04
.SH RETURN VALUE
Packit 7cfc04
On success, these functions return the same value as
Packit 7cfc04
the analogous functions described in
Packit 7cfc04
.BR remainder (3).
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I x
Packit 7cfc04
or
Packit 7cfc04
.I y
Packit 7cfc04
is a NaN, a NaN is returned.
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I x
Packit 7cfc04
is an infinity,
Packit 7cfc04
and
Packit 7cfc04
.I y
Packit 7cfc04
is not a NaN,
Packit 7cfc04
a domain error occurs, and
Packit 7cfc04
a NaN is returned.
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I y
Packit 7cfc04
is zero,
Packit 7cfc04
and
Packit 7cfc04
.I x
Packit 7cfc04
is not a NaN,
Packit 7cfc04
a domain error occurs, and
Packit 7cfc04
a NaN is returned.
Packit 7cfc04
.SH ERRORS
Packit 7cfc04
See
Packit 7cfc04
.BR math_error (7)
Packit 7cfc04
for information on how to determine whether an error has occurred
Packit 7cfc04
when calling these functions.
Packit 7cfc04
.PP
Packit 7cfc04
The following errors can occur:
Packit 7cfc04
.TP
Packit 7cfc04
Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \
Packit 7cfc04
and the other argument is not a NaN
Packit 7cfc04
.\" .I errno
Packit 7cfc04
.\" is set to
Packit 7cfc04
.\" .BR EDOM .
Packit 7cfc04
An invalid floating-point exception
Packit 7cfc04
.RB ( FE_INVALID )
Packit 7cfc04
is raised.
Packit 7cfc04
.PP
Packit 7cfc04
These functions do not set
Packit 7cfc04
.IR errno .
Packit 7cfc04
.\" FIXME . Is it intentional that these functions do not set errno?
Packit 7cfc04
.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6802
Packit 7cfc04
.SH VERSIONS
Packit 7cfc04
These functions first appeared in glibc in version 2.1.
Packit 7cfc04
.SH ATTRIBUTES
Packit 7cfc04
For an explanation of the terms used in this section, see
Packit 7cfc04
.BR attributes (7).
Packit 7cfc04
.TS
Packit 7cfc04
allbox;
Packit 7cfc04
lbw30 lb lb
Packit 7cfc04
l l l.
Packit 7cfc04
Interface	Attribute	Value
Packit 7cfc04
T{
Packit 7cfc04
.BR remquo (),
Packit 7cfc04
.BR remquof (),
Packit 7cfc04
.BR remquol ()
Packit 7cfc04
T}	Thread safety	MT-Safe
Packit 7cfc04
.TE
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
C99, POSIX.1-2001, POSIX.1-2008.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR fmod (3),
Packit 7cfc04
.BR logb (3),
Packit 7cfc04
.BR remainder (3)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.