beautypg.com

Labs, Ldexp, Ldiv – Zilog EZ80F916 User Manual

Page 367: Labs ldexp ldiv

background image

UM014423-0607

C Standard Library

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

347

labs

Computes the absolute value of a long int j.

Synopsis

#include
long labs(long j);

Example

long i=-193250;
long j;
j=labs(i);

ldexp

Multiplies a floating-point number by an integral power of 2. A range error can occur.

Synopsis

#include
double ldexp(double x, int exp);

Returns

The value of x times 2 raised to the power of exp.

Example

double x=1.235;
int exp=2;
double y;
y=ldexp(x,exp);

ldiv

Computes the quotient and remainder of the division of the numerator

numer

by the

denominator

denom

. If the division is inexact, the sign of the quotient is that of the

mathematical quotient, and the magnitude of the quotient is the largest integer less than
the magnitude of the mathematical quotient.

Synopsis

#include
ldiv_t ldiv(long numer, long denom);

Example

long x=25000;
long y=300;

This manual is related to the following products: