Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
Library Functions
 2012 Microchip Technology Inc.
DS52053B-page 333
FMOD 
Synopsis
#include <math.h>
 
double fmod (double x, double y)
Description
The function 
fmod
 returns the remainder of 
x
/
y
 as a floating-point quantity.
Example
#include <math.h>
void 
main (void)
{
    double rem, x;
    x = 12.34;
    rem = fmod(x, 2.1);
}
Return Value
The floating-point remainder of x/y.
FREXP 
Synopsis
#include <math.h>
 
double frexp (double f, int * p)
Description
The 
frexp()
 function breaks a floating-point number into a normalized fraction and an 
integral power of 2. The integer is stored into the 
int
 object pointed to by 
p
. Its return 
value x is in the interval (0.5, 1.0) or zero, and 
f
 equals x times 2 raised to the power 
stored in 
*p
. If 
f
 is zero, both parts of the result are zero.
Example
#include <math.h>
#include <stdio.h>
void 
main (void)
{
    double f;
    int i;
    f = frexp(23456.34, &i);
    printf("23456.34 = %f * 2^%d\n", f, i);
}
See Also
ldexp()