Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  question about round function (David McBride)
   2. Re:  return IO () vs. () (Chadda? Fouch?)


----------------------------------------------------------------------

Message: 1
Date: Sun, 29 May 2011 02:59:55 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] question about round function
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Double doesn't have so much precision at that value.  It has nothing
to do with the round function.

Prelude> 3.499999999999999 :: Double
3.499999999999999

Prelude> 3.4999999999999999 :: Double
3.5

On Sun, May 29, 2011 at 2:39 AM, Prashant Shah <[email protected]> wrote:
> Hi,
>
> This is my first time with Haskell.
>
> Here is what I found while trying out some examples :
>
> Prelude> round 3.499999999999999
> 3
> it :: Integer
>
> Prelude> round 3.4999999999999999
> 4
> it :: Integer
>
> ---------------
>
> Prelude> round 111111.49999999999
> 111111
> it :: Integer
> Prelude> round 111111.499999999999
> 111112
> it :: Integer
>
> Is it something to do with the CPU register size ?
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>



------------------------------

Message: 2
Date: Sun, 29 May 2011 10:29:10 +0200
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] return IO () vs. ()
To: Antoine Latter <[email protected]>
Cc: Neil Jensen <[email protected]>, [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

On Sun, May 29, 2011 at 3:33 AM, Antoine Latter <[email protected]> wrote:
> I think you might have your parenthesis in the wrong spot.
>
> Instead of
>
>> x >>= (\a -> y a) >> z
>
> you probably want:
>
>> x >>= (\a -> y a >> z)
>
> Does that make sense?
>

No, that shouldn't change anything (except maybe performance, but not
here), monads have a property close to associativity which means that
changing the parenthesis shouldn't change the meaning of your code,
you don't have to worry about that.

-- 
Jeda?



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 35, Issue 58
*****************************************

Reply via email to