Functions | |
double | trio_nzero (void) |
Generate negative zero. More... | |
double | trio_pinf (void) |
Generate positive infinity. More... | |
double | trio_ninf (void) |
Generate negative infinity. More... | |
double | trio_nan (void) |
Generate NaN. More... | |
int | trio_isnan (double number) |
Check for NaN. More... | |
int | trio_isinf (double number) |
Check for infinity. More... | |
int | trio_isfinite (double number) |
Check for finity. More... | |
int | trio_signbit (double number) |
Examine the sign of a number. More... | |
int | trio_fpclassify (double number) |
Examine the class of a number. More... |
SYNOPSIS
cc ... -ltrio -lm #include <trionan.h>
DESCRIPTION
Certain arithmetical operations does not result in normal numbers. Instead they result in special quantities that must be handled differently by the floating-point hardware. These includes Infinity and Not-A-Number (NaN).
For example, 0/0 (zero divided by zero) yields NaN. Any operation which involves a NaN will result in NaN. Any comparison involving NaN will be unsuccessful, even if NaN is compared to NaN.
These special quantities are represented with special bit patterns by the floating-point hardware, and this bit patterns depend on the hardware. There may even be hardware that does not support special quantities, so the functions in this module are not guaranteed to work on all platforms.
The approach used in this module is to (in decreasing order of importance)
This module does not depend on the rest of trio, and can thus be reused separately. The following files are necessary:
triodef.h
trionan.h
trionan.c
|
Examine the class of a number.
|
|
Check for finity.
|
|
Check for infinity.
|
|
Check for NaN.
|
|
Generate NaN.
|
|
Generate negative infinity.
|
|
Generate negative zero.
|
|
Generate positive infinity.
|
|
Examine the sign of a number.
|