Fabs, fabsf, Floor, floorf, Fmod, fmodf – Zilog ZUSBOPTS User Manual

Page 444: Fabs, fabsf floor, floorf fmod, fmodf, Synopsis, Returns, Example

Advertising
background image

Standard Functions

UM017105-0511

416

Zilog Developer Studio II – ZNEO™
User Manual

fabs, fabsf

Computes the absolute value of a floating-point number

x

.

Synopsis

#include <math.h>

double fabs(double x);

float fabsf(float x);

Returns

The absolute value of x.

Example

double y=6.23;

double x;

x=fabs(y);

floor, floorf

Computes the largest integer not greater than x.

Synopsis

#include <math.h>

double floor(double x);

float floorf(float x);

Returns

The largest integer not greater than x, expressed as a

double

for

floor

and expressed as

a

float

for

floorf

.

Example

double y=6.23;

double x;

x=floor(y);

fmod, fmodf

Computes the floating-point remainder of

x

/

y

. If the quotient of

x

/

y

cannot be represented,

the behavior is undefined.

Advertising
This manual is related to the following products: