G'day all.
Quoting Andrew Coppin <[EMAIL PROTECTED]>:
So many other programming languages allow weird things to happen with
numeric overflows... it would be nice if Haskell didn't.
It would nice if CPUs supported trapping integer arithmetic.
Cheers,
Andrew Bromage
___
On 13/08/07, Pekka Karjalainen <[EMAIL PROTECTED]> wrote:
> On 8/13/07, L.Guo <[EMAIL PROTECTED]> wrote:
> > Hi All:
>
> Hello,
>
> >
> > I am reading http://www.haskell.org/haskellwiki/Prime_numbers
> >
> > The code in sector "1 Bitwise prime sieve".
> >
> > I have 3 questions about it.
> >
> > 1)
Andrew Coppin wrote:
Stefan O'Rear wrote:
Also, large numbers don't (this is arguably a bug...) have restricted
types:
[EMAIL PROTECTED]:~$ ghc -e '100 :: Int'
-1486618624
So many other programming languages allow weird things to happen with
numeric overflows... it would b
Stefan O'Rear wrote:
Also, large numbers don't (this is arguably a bug...) have restricted
types:
[EMAIL PROTECTED]:~$ ghc -e '100 :: Int'
-1486618624
So many other programming languages allow weird things to happen with
numeric overflows... it would be nice if Haskell didn
L.Guo wrote:
> Because 10,000,000 is too large for a Int
On my pitiful system,
> maxBound::Int
2147483647
is certainly greater than
1000
.
> it is always in type of Integer or some higher level data type.
Haskell doesn't do static checking like that. In GHC on my system (where
10,000,000,000
On Mon, Aug 13, 2007 at 11:23:59PM +0800, L.Guo wrote:
> Because 10,000,000 is too large for a Int, it is always in type of Integer or
> some higher level data type.
In Haskell, Int always supports at least -536,870,912 to 536,870,911.
Also, large numbers don't (this is arguably a bug...) have r
: [Haskell-cafe] A few questions on primes generating.
On Tuesday 14 August 2007 00:22, L.Guo wrote:
> 2) We have this type definition :
> pureSieve :: Int -> Int
>Why there is no error (type mismatch) of this call in func main :
> pureSieve 1000
The Haskell Report s
On 8/13/07, L.Guo <[EMAIL PROTECTED]> wrote:
> Hi All:
Hello,
>
> I am reading http://www.haskell.org/haskellwiki/Prime_numbers
>
> The code in sector "1 Bitwise prime sieve".
>
> I have 3 questions about it.
>
> 1) In function go, what does the number 46340 mean ? Is it sqrt(MAX_LONG) ?
Yes, it
On Tuesday 14 August 2007 00:22, L.Guo wrote:
> 2) We have this type definition :
> pureSieve :: Int -> Int
>Why there is no error (type mismatch) of this call in func main :
> pureSieve 1000
The Haskell Report says that an Int covers at least the range [- 2^29, 2^29 -
1], which
Hi All:
I am reading http://www.haskell.org/haskellwiki/Prime_numbers
The code in sector "1 Bitwise prime sieve".
I have 3 questions about it.
1) In function go, what does the number 46340 mean ? Is it sqrt(MAX_LONG) ?
2) We have this type definition :
pureSieve :: Int -> Int
Why there i
10 matches
Mail list logo