FMOD(3) BSD Library Functions Manual FMOD(3)NAME
fmod, fmodf, fmodl -- floating-point remainder functions
LIBRARY
Math Library (libm, -lm)
SYNOPSIS
#include <math.h>
double
fmod(double x, double y);
float
fmodf(float x, float y);
long double
fmodl(long double x, long double y);
DESCRIPTION
The fmod(), fmodf(), and fmodl() functions compute the floating-point remainder of x/ y.
RETURN VALUES
If y is non-zero, the fmod(), fmodf(), and fmodl() functions return the value x-i*y, for some integer i, such that the result has the same
sign as x and magnitude less than the magnitude of y. If y is zero, a NaN is produced.
SEE ALSO math(3)STANDARDS
The fmod(), fmodf(), and fmodl() functions conform to ISO/IEC 9899:1999 (``ISO C99'').
BSD June 19, 2008 BSD
Check Out this Related Man Page
fmod(3) Library Functions Manual fmod(3)NAME
fmod, drem, remainder - Compute the floating-point remainder
LIBRARY
Math Library (libm.a)
SYNOPSIS
#include <math.h>
double fmod (double x, double y); float fmodf (float x, float y); long double fmodl (long double x,
long double y); double drem (double x, double y); float dremf (float x, float y); long double dreml
(long double x, long double y); double remainder (double x, double y); float remainderf (float x, float y); long double
remainderl (long double x, long double y);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
fmod(): XPG4
remainder(): XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
The fmod(), fmodf(), and fmodl() functions return the remainder r = x - n*y, where n = trunc(x/y). The result has the same sign as x and
magnitude less than the magnitude of y. The remainder is computed exactly and |r| is less than |y|.
The drem(), dremf(), dreml(), remainder(), remainderf(), and remainderl() functions return the remainder r = x - n*y, where n = rint(x/y).
Additionally, if |n - x/y|=1/2, then n is even. The remainder is computed exactly and |r| is less than or equal to |y|/2.
The drem() and remainder() functions are aliases of each other. The dremf(), and remainderf() functions are aliases of each other. The
dreml() and remainderl() functions are aliases of each other.
The following table describes function behavior in response to exceptional arguments:
---------------------------------------------------------------------------
Function Exceptional Argument Routine Behavior
---------------------------------------------------------------------------
fmod(), fmodf(), fmodl() x = infinity Invalid argument
fmod(), fmodf(), fmodl() y = 0 Invalid argument
drem(), dremf(), dreml() x = infinity Invalid argument
drem(), dremf(), dreml() y = 0 Invalid argument
remainder() x = infinity Invalid argument
remainderf() x = infinity Invalid argument
remainderl() x = infinity Invalid argument
remainder() y = 0 Invalid argument
remainderf() y = 0 Invalid argument
remainderl() y = 0 Invalid argument
---------------------------------------------------------------------------
delim off
fmod(3)
I have written this C++ program and I am using getopt_long and want to chech when the user supplies the arguments so that I can put a default or otherwise.
Currently I am using hasargv or Pc.get_string("key",s), Pc.get_real("key",s), etc
to detect whether the user supplied a value.
For... (3 Replies)
I am using ifstream to open a file using
std::fstream::open
void open ( const char * filename, ios_base::openmode mode = ios_base::in );
However I want to use a string instead of a char* as follows but having a problem on how to do this
string val_ifmodl = “fred.modl”
ifstream ifs_modl;... (2 Replies)
I am using getopt_long to pass arguments to a C++ program. Arguments are passed with a key and a value separated by a space of '=' sign. Some options do not need to assign a value to them.
Example:
./raytrac dist=0.3 --color
I have some classes that need to use some of these... (18 Replies)