beautypg.com

Atan2, Atof, Atoi – Zilog Z8F0130 User Manual

Page 457: Atan2 atof atoi

background image

UM013037-1212

atan2

Zilog Developer Studio II – Z8 Encore!

User Manual

433

atan2

Computes the principal value of the arc tangent of y/x, using the signs of both arguments
to determine the quadrant of the return value. A domain error occurs if both arguments are
zero.

Synopsis

#include

double atan2(double y, double x);

Returns

The arc tangent of y/x, in the range [-pi, +pi].

Example

double y=.1234;

double x=.4321;

double z;

z=atan2(y,x);

atof

Converts the string pointed to by nptr to double representation. Except for the behavior on
error,

atof

is equivalent to

strtod (nptr, (char **)NULL)

.

Synopsis

#include

double atof(char *nptr);

Returns

The converted value.

Example

char str []="1.234";

double x;

x= atof(str);

atoi

Converts the string pointed to by nptr to int representation. Except for the behavior on
error, it is equivalent to

(int)strtol(nptr, (char **)NULL, 10)

.