NAME
drem, dremf, dreml, remainder, remainderf, remainderl - floating-point remainder function
SYNOPSIS
#include <math.h> /* The C99 versions */ double remainder(double x, double y); float remainderf(float x, float y); long double remainderl(long double x, long double y); /* Obsolete synonyms */ double drem(double x, double y); float dremf(float x, float y); long double dreml(long double x, long double y); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): remainder(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500 || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE remainderf(), remainderl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE drem(), dremf(), dreml(): /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
These functions compute the remainder of dividing x by y. The return value is x-n*y, where n is the value x / y, rounded to the nearest integer. If the absolute value of x-n*y is 0.5, n is chosen to be even. These functions are unaffected by the current rounding mode (see fenv(3)). The drem() function does precisely the same thing.
RETURN VALUE
On success, these functions return the floating-point remainder, x-n*y. If the return value is 0, it has the sign of x. If x or y is a NaN, a NaN is returned. If x is an infinity, and y is not a NaN, a domain error occurs, and a NaN is returned. If y is zero, and x is not a NaN, a domain error occurs, and a NaN is returned.
ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions. The following errors can occur: Domain error: x is an infinity and y is not a NaN errno is set to EDOM (but see BUGS). An invalid floating-point exception (FE_INVALID) is raised. These functions do not set errno for this case. Domain error: y is zero errno is set to EDOM. An invalid floating-point exception (FE_INVALID) is raised.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). ┌───────────────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├───────────────────────────┼───────────────┼─────────┤ │drem(), dremf(), dreml(), │ Thread safety │ MT-Safe │ │remainder(), remainderf(), │ │ │ │remainderl() │ │ │ └───────────────────────────┴───────────────┴─────────┘
CONFORMING TO
The functions remainder(), remainderf(), and remainderl() are specified in C99, POSIX.1-2001, and POSIX.1-2008. The function drem() is from 4.3BSD. The float and long double variants dremf() and dreml() exist on some systems, such as Tru64 and glibc2. Avoid the use of these functions in favor of remainder() etc.
BUGS
Before glibc 2.15, the call remainder(nan(""), 0); returned a NaN, as expected, but wrongly caused a domain error. Since glibc 2.15, a silent NaN (i.e., no domain error) is returned. Before glibc 2.15, errno was not set to EDOM for the domain error that occurs when x is an infinity and y is not a NaN. errno was not set
EXAMPLE
The call "remainder(29.0, 3.0)" returns -1.
SEE ALSO
div(3), fmod(3), remquo(3)
COLOPHON
This page is part of release 4.09 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. 2016-12-12 REMAINDER(3)
More Linux Commands
manpages/winch.3ncurses.html
winch(3ncurses) - get a character and attributes from a curs
These routines return the character, of type chtype, at the current position in the named window. If any attributes are set for that position, their values are
manpages/getsysinfo.1.html
getsysinfo(1) (Commands - Linux manual page)...............
Collect some system data that are useful for debugging hardware detection bugs. General Commands Manual getsysinfo.1 (User Commands Section - Linux manual page)
manpages/gnutls_x509_crq_get_key_rsa_raw.3.html
gnutls_x509_crq_get_key_rsa_raw(3) - API function (ManPage)
gnutls_x509_crq_get_key_rsa_raw.3 - This function will export the RSA public keys parameters found in the given structure. The new parameters will be allocated
manpages/mysqlbinlog.1.html
mysqlbinlog(1) - utility for processing binary log files....
The servers binary log consists of files containing events that describe modifications to database contents. The server writes these files in binary format. To
manpages/XExposeEvent.3.html
XExposeEvent(3) - Expose event structure - Linux man page...
The structure for Expose events contains: typedef struct { int type; /* Expose */ unsigned long serial; /* # of last request processed by server */ Bool send_ev
manpages/logprof.8.html
logprof(8) utility for updating AppArmor security profiles
aa-logprof is an interactive tool used to review AppArmor generated messages and update AppArmor security profiles. Running aa-logprof will scan the log file an
manpages/form_new.3form.html
form_new(3form) - create and destroy forms - Linux man page
The function new_form creates a new form connected to a specified field pointer array (which must be NULL-terminated). The function free_form disconnects form f
manpages/gslp.1.html
gslp(1) - Format and print text using ghostscript (ManPage)
This utility provides functionality approximately equivalent to the Unix enscript(1) program. It prints plain text files using a single font. It currently handl
manpages/pam_get_item.3.html
pam_get_item(3) - getting PAM informations - Linux man page
The pam_get_item function allows applications and PAM service modules to access and retrieve PAM informations of item_type. Upon successful return, item contain
manpages/intel_gpu_top.1.html
intel_gpu_top(1) - Display a top-like summary of Intel GPU u
intel_gpu_top is a tool to display usage information of an Intel GPU. It requires root privilege to map the graphics device. Options -s [samples per second] num
manpages/mrtg-rrd.1.html
mrtg-rrd(1) How to use RRDtool with MRTG - Linux man page...
When using mrtg with RRDtool you are replacing rateup with the RRDtool perl module RRDs.pm. To enable RRDtool support in mrtg you have to add the line LogFormat
manpages/getcontext.3.html
getcontext(3) get or set the user context - Linux man page
In a System V-like environment, one has the two types mcontext_t and ucontext_t defined in <ucontext.h> and the four functions getcontext(), setcontext(), makec
