[Haskell-cafe] Re: Why 'round' does not just round numbers ?

Achim Schneider barsoap at web.de
Mon Oct 27 08:42:24 EDT 2008


"Felipe Lessa" <felipe.lessa at gmail.com> wrote:

> On Mon, Oct 27, 2008 at 10:20 AM, Achim Schneider <barsoap at web.de>
> wrote:
> > Hmmm... I'm wondering whether there's a standard C way to set the
> > rounding direction.
> 
> nearbyint() and rint() may be used, and the rounding mode can be set
> by fesetround(). IIRC, this is C99.
> 
Yes, they are, thanks.

Because of stuff like this, I sometimes wish Haskell supported not only
morphisms of the type

Hask a -> Hask b

but

(Hask h, RoundDownwards h) => h a -> h b

{-# LANGUAGE CategoryClasses #-} ?

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.



More information about the Haskell-Cafe mailing list