Precision of `Double's in Hugs

Liyang Hu liyang@nerv.cx
Sun, 13 Jan 2002 01:43:32 +0000


Evening,

Thanks for the near-instantaneous reply!

On Sat, Jan 12, 2002 at 05:59:02PM -0500, Scott Turner wrote:
> Welcome. Hope you find it as fun and useful as I.

I'm sure I will! My wee adventure into the world of functional
programming has been nothing short of delightful so far, and there's
so much more to figure out ...

> > Why is it that `Double's in Hugs only seem to have the same
> > precision as a `Float'?
> As the Hugs manual says in 9.1, The Double type is implemented as
> a single precision float (this isn't forbidden by the standard but
> it is unusual).

Ah. They don't seem to give any justification for doing this either!
;_;

> But if you build Hugs yourself, there's a line in options.h

'fraid I've been too spoilt by Debian, haven't built anything from
source in ages ... I'll notify Hugs' package maintainer and see if I
can convince him/her to apply this ...

> From a bit of browsing the code, it appears that setting
> USE_DOUBLE_PRECISION will increase the precision of both Float
> and Double types.

Don't suppose the Haskell spec put a maximum precision level on
Floats? (Or I take it it's the standard Double >= Float?)

mata ne,
/Liyang
-- 
.--| Liyang Hu |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
|  A [programming] language that doesn't affect the way you think        |
|  about programming is not worth knowing.                               |