beautypg.com

Modf, Printf, Modf pow printf – Zilog Z8F0130 User Manual

Page 475

background image

UM013037-1212

modf

Zilog Developer Studio II – Z8 Encore!

User Manual

451

modf

Breaks the argument value into integral and fractional parts, each of which has the same
sign as the argument. It stores the integral part as a

double

in the object pointed to by iptr.

Synopsis

#include

double modf(double value, double *iptr);

Returns

The signed fractional part of value.

Example

double x=1.235;

double f;

double I;

i=modf(x, &f);

pow

Computes the x raised to the power of y. A domain error occurs if x is zero and y is less
than or equal to zero, or if x is negative and y is not an integer. A range error can occur.

Synopsis

#include

double pow(double x, double y);

Returns

The value of x raised to the power y.

Example

double x=2.0;

double y=3.0;

double=res;

res=pow(x,y);

printf

Writes output to the stream pointed to by stdout, under control of the string pointed to by
format that specifies how subsequent arguments are converted for output.

A format string contains two types of objects: plain characters, which are copied
unchanged to stdout, and conversion specifications, each of which fetch zero or more sub-