Re: Spartns (fast and flexible tensor representation for Common Lisp)
- From: Waldek Hebisch <hebisch@xxxxxxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 21:08:16 +0000 (UTC)
John Thingstad <jpthing@xxxxxxxxx> wrote:
P? Wed, 30 Jan 2008 19:21:52 +0100, skrev Waldek Hebisch
<hebisch@xxxxxxxxxxxxxxxx>:
Well, as a user if I give integer arguments to floating point
functions I expect double precision result. But Ansi says to
the result is single-float. I consider this as a bug in Ansi
standard.
Why?
Integers are "most precise" numbers. It makes sense to preserve
as much of this accuracy as possible when converting them to
floats. Since floating point formats more precise than double
are available on only on some platforms, double is most precise
format which should be "always" available. Having default which
is likely to give significant loss of precision is inconsistent
with the rest of the language: normally one gets "slow but
correct" behaviour and needs declaration to choose fast, but
unsafe variants.
Now, I do not know the real reason that single-float
in gcl is the same as double-float. But making single-float
the same as double-float looks like reasonable way to correct
problem with Ansi spec.
Only if you don't give a damn about efficiency. Many numeric processors
can calulate several short-float calculations in paralell but only one
long-float.
gcl short-float _is_ single precision, so you can get efficiency if
single precision is accurate enough for you.
--
Waldek Hebisch
hebisch@xxxxxxxxxxxxxxxx
.
- References:
- Re: Spartns (fast and flexible tensor representation for Common Lisp)
- From: Jeronimo Pellegrini
- Re: Spartns (fast and flexible tensor representation for Common Lisp)
- From: Thomas F. Bur***
- Re: Spartns (fast and flexible tensor representation for Common Lisp)
- From: Waldek Hebisch
- Re: Spartns (fast and flexible tensor representation for Common Lisp)
- From: John Thingstad
- Re: Spartns (fast and flexible tensor representation for Common Lisp)
- Prev by Date: Re: better way to enumerate
- Next by Date: Re: Paul Graham's Arc is released today... what is the long term impact?
- Previous by thread: Re: Spartns (fast and flexible tensor representation for Common Lisp)
- Next by thread: Re: Spartns (fast and flexible tensor representation for Common Lisp)
- Index(es):