beautypg.com

Frexp, Getchar, Frexp getchar – Zilog EZ80F916 User Manual

Page 362

background image

UM014423-0607

C Standard Library

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

342

frexp

Breaks a floating-point number into a normalized fraction and an integral power of 2. It
stores the integer in the

int

object pointed to by

exp

.

Synopsis

#include
double frexp(double value, int *exp);

Returns

The value x, such that x is a

double

with magnitude in the interval [1/2, 1] or zero, and

value equals x times 2 raised to the power *exp. If value is zero, both parts of the result are
zero.

Example

double y, x=16.4;
int n;
y=frexp(x,&n);

getchar

Waits for the next character to appear at the serial port and return its value.

Synopsis

#include
int getchar(void);

Returns

The next character from the input stream pointed to by stdin. If the stream is at end-of-file,
the end-of-file indicator for the stream is set, and

getchar

returns EOF. If a read error

occurs, the error indicator for the stream is set, and

getchar

returns EOF.

Example

int i;
i=getchar();

NOTE: This function makes a call to hardware-specific functions to get data from the

UART. You must either link to ZSL to provide these hardware-specific functions
or provide your own equivalent functions. See “Run-Time Library” on page 154.

This manual is related to the following products: