Null<double> and arithmetics

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Null<double> and arithmetics

Vadim Ogranovich-3
Hi,

Just want to make a suggestion. Currently
double x = Null<double>() * 0.01;
produces a valid double, which is confusing (I ran into it when I read
interest rates in %% and then converted to non-percent numbers).

I heard that there is a IEEE standard + libraries for things like NaN, Inf,
etc. It would be nice if  Null<numeric> conform to that standard.
Another option is to use Rmath library (a standalone byproduct of R-project)
which seems to handle NaN-s properly, but I don't have first-hand experience
with it.

Thanks, Vadim

--------------------------------------------------
DISCLAIMER
This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information.  If you are not the intended recipient of this
e-mail, you are hereby notified that any dissemination, distribution or
copying of this e-mail, and any attachments thereto, is strictly prohibited.
If you have received this e-mail in error, please immediately notify me and
permanently delete the original and any copy of any e-mail and any printout
thereof.

E-mail transmission cannot be guaranteed to be secure or error-free.  The
sender therefore does not accept liability for any errors or omissions in
the contents of this message which arise as a result of e-mail transmission.

NOTICE REGARDING PRIVACY AND CONFIDENTIALITY

Knight Trading Group may, at its discretion, monitor and review the content
of all e-mail communications.



Reply | Threaded
Open this post in threaded view
|

Re: Null<double> and arithmetics

Luigi Ballabio-4
At 04:50 PM 5/5/02 -0500, Vadim Ogranovich wrote:
>Just want to make a suggestion. Currently
>double x = Null<double>() * 0.01;
>produces a valid double, which is confusing (I ran into it when I read
>interest rates in %% and then converted to non-percent numbers).
>
>I heard that there is a IEEE standard + libraries for things like NaN, Inf,
>etc. It would be nice if  Null<numeric> conform to that standard.

It would indeed.
Does anybody have any insight into this? Any URL?

Bye,
         Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Null<double> and arithmetics

Dirk Eddelbuettel
In reply to this post by Vadim Ogranovich-3
> At 04:50 PM 5/5/02 -0500, Vadim Ogranovich wrote:
> >Just want to make a suggestion. Currently
> >double x = Null<double>() * 0.01;
> >produces a valid double, which is confusing (I ran into it when I read
> >interest rates in %% and then converted to non-percent numbers).
> >
> >I heard that there is a IEEE standard + libraries for things like NaN, Inf,
> >etc. It would be nice if  Null<numeric> conform to that standard.
>
> It would indeed.
> Does anybody have any insight into this? Any URL?

There is one, isn't it called IEEE 854 or something?  

I recall something authored a long time ago by a Berkeley ElecEng. prof.
A good google search might unearth that; else I check my old Octave
and R folders at home [ both packages deal with NaN ].

Dirk

--
According to the latest figures, 43% of all signatures are totally worthless.  


Reply | Threaded
Open this post in threaded view
|

Re: Null<double> and arithmetics

Dirk Eddelbuettel
In reply to this post by Vadim Ogranovich-3
> > At 04:50 PM 5/5/02 -0500, Vadim Ogranovich wrote:
> > >I heard that there is a IEEE standard + libraries for things like NaN, Inf,
> > >etc. It would be nice if  Null<numeric> conform to that standard.
> >
> > It would indeed.
> > Does anybody have any insight into this? Any URL?
>
> There is one, isn't it called IEEE 854 or something?  
>
> I recall something authored a long time ago by a Berkeley ElecEng. prof.

It's IEEE 754, see  http://www.cs.berkeley.edu/~wkahan/

--
According to the latest figures, 43% of all signatures are totally worthless.