DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Floating point operations

Square root

IEEE requires the square root of a negative non-zero number to raise invalid operation, whereas UNIX operating system compatibility requires square root to return 0.0 with errno set to EDOM.

When you use the -a ods30 option to the cc command, the sqrt() routine in the C compilation system returns 0.0 for negative non-zero inputs and sets errno to EDOM. Otherwise, the square root of a negative non-zero number raises invalid operation and returns a NaN, in strict conformance with the IEEE standard.


Next topic: Compares and unordered condition
Previous topic: Conversion of floating point formats to integer

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003