Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2003-07-25 15:09:08


gmelquio_at_[hidden] writes:

| En réponse à Gabriel Dos Reis <gdr_at_[hidden]>:
|
| [snip]
|
| > | We are speaking about quiet NaNs here. And so I
| > | was justifying why the interval library computes "v != v" in order to
| > | detect quiet NaNs. I never intended to speak about signaling NaNs.
| >
| > The point of my mail was that it is a mistake to ignore sNaNs.
|
| It seems there is a misunderstanding.

Certainly, there is. Given the amount of mails, and apparently no
concrete convergence.

| In the context of the interval library, think about this function as
| an internal function.

Please, assume I have some knowledge of interval arithmetic -- or
else, I will shut up.

| If quiet NaNs are available, the library will use them. And this
| function is here to detect them.

I understand the purpose of the function. What I'm saying is that it
is ill-implemented, or the implementation is not correct.

| It is meant to detect values created by the library itself. The
| library only creates quiet NaNs,

I fully understand how NaNs get created and that usual arithmetic
operations don't create sNaNs. The point you seem to miss is that
values are not only created by interval arithmetic operations.

[...]

| > Ths point was the isnan() query should *not* trigger a trap.
|
| The way the library uses it, the isnan function can not trigger a trap unless
| the user messed with something. Moreover, it is a private function,
| the user is not supposed to use it.

The fact that the function is private has nothing to do with it
triggering a trap or not.

| On a more general side, please keep in mind that *signaling* NaNs are meant to
| trap when used ("used" can be a simple copy, the standard leaves it
| implementation-defined).

They trap only when operands of arithmetic operations.

| If the user suddenly decides to put a signaling NaN in
| a floating-point variable, she shouldn't be surprised if the program traps as
| soon as it uses this variable. I don't understand why the interval library
| should prevent such a behavior,

I'm not saying the interval library should prevent that behaviour.
I'm syaing the interval arithmetic should not provide a trapping isnan
function. That is a different matter.

-- Gaby


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk