Tim Peters <tim.one@comcast.net> writes: > It's cute: even in C99, an implementation must treat sqrt(negative_number) > as a domain error. However, under C99 rules: > > On a domain error, the function returns an implementation-defined > value; whether the integer expression errno acquires the value > EDOM is implementation-defined. Is that the final text? My copy says On a domain error, the function returns an implementation-defined value; if the integer expression math_errhandling & MATH_ERRNO is nonzero, the integer expression errno acquires the value EDOM; if the integer expression math_errhandling & MATH_ERREXCEPT is nonzero, the ``invalid'' floating-point exception is raised. but it comes from a draft only (99-04). If this is what C99 says, you actually can tell, in C, whether checking errno will help indicating the error. > Do that, and in the end you get a library that still honks off > IEEE-754 fans anyway (which has its own elaborate and precise rules > for dealing with fp exceptions). If the C implementation also implements Annex F, IEEE-754 fans should be satisfied, no? Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4