|
|
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.