.\" @(#)ieee_sun.3m 1.4 97/02/25 SMI; .TH ieee_sun 3M "1 Sep 1993" .ds nn \fINaN\fR .SH NAME ieee_sun, fp_class, isinf, isnormal, issubnormal, iszero, signbit, nonstandard_arithmetic, standard_arithmetic, ieee_retrospective \- miscellaneous functions for IEEE arithmetic .SH SYNOPSIS .LP .B cc .RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." .B \-lsunmath -lm .RI "[ " "library" " \|.\|.\|. ]" .LP .B #include .LP .BI "enum fp_class_type fp_class(double " "x" ); .LP .BI "int isinf(double " "x" ); .LP .BI "int isnormal(double " "x" ); .LP .BI "int issubnormal(double " "x" ); .LP .BI "int iszero(double " "x" ); .LP .BI "int signbit(double " "x" ); .LP .B void nonstandard_arithmetic(void); .LP .B void standard_arithmetic(void); .LP .B #include .LP .BI "void ieee_retrospective(FILE *" "f" ); .LP .ne 13 .SH DESCRIPTION .IX "fp_class function" "" "\fLfp_class()\fP function" .IX "signbit function" "" "\fLsignbit()\fP function" .IX "iszero function" "" "\fLiszero()\fP function" .IX "issubnormal function" "" "\fLissubnormal()\fP function" .IX "isnormal function" "" "\fLisnormal()\fP function" .IX "isinf function" "" "\fLisinf()\fP function" .IX "nonstandard_arithmetic function" "" "\fLnonstandard_arithmetic()\fP function" .IX "standard_arithmetic function" "" "\fLstandard_arithmetic()\fP function" .IX "ieee_retrospective function" "" "\fLieee_retrospective()\fP function" .LP Please see .BR copysign (3M), .BR ilogb (3M), .BR isnan (3M), .BR nextafter (3M), .BR remainder "(3M), and " .BR scalbn (3M), for a description of a few more commonly used (and standardized) .SM ANSI/IEEE Std 754-1985 related functions. .LP Most of the functions provide capabilities suggested in the Appendix of .SM ANSI/IEEE Std 754-1985. .LP .BI fp_class( x ) corresponds to the IEEE's class() and classifies .I x as zero, subnormal, normal, \(if, or quiet or signaling \*(nn; .B defines .IR "enum fp_class_type" . .LP The following functions return 0 if the indicated condition is not satisfied: .RS .PD 0 .TP 15 .BI isinf( x ) returns 1 if .I x is \(if .TP .BI isnormal( x ) returns 1 if .I x is normal .TP .BI issubnormal( x ) returns 1 if .I x is subnormal .TP .BI iszero( x ) returns 1 if .I x is zero .TP .BI signbit( x ) returns 1 if .IR x 's sign bit is set .PD .RE .LP .B nonstandard_arithmetic() and .B standard_arithmetic() are meaningful on systems that provide an alternative faster mode of floating-point arithmetic that does not conform to the default IEEE Standard. Nonstandard modes vary among implementations; nonstandard mode may, for instance, result in setting subnormal results to zero or in treating subnormal operands as zero, or both, or something else. .B standard_arithmetic() reverts to the default standard mode. On systems that provide only one mode, these functions have no effect. .LP .BI ieee_retrospective( f ) prints a message to the .BI "FILE *" f listing all non-default floating-point modes and status in effect when called, including IEEE accrued exception-occurred status bits, IEEE rounding direction and precision modes, IEEE trap-enable modes, and nonstandard arithmetic mode. .BI ieee_retrospective( f ) is intended to be used at the end of a program to indicate exceptional floating-point conditions that might have affected the result. .SH "SEE ALSO" .BR copysign (3M), .BR ieee_flags (3M), .BR ieee_handler (3M), .BR ilogb (3M), .BR isnan (3M), .BR nextafter (3M), .BR remainder (3M), .BR scalbn (3M), .BR floatingpoint (5).