Re: [elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:37:29 PM UTC+1, Rupert Smith wrote:
>
> On Tuesday, September 20, 2016 at 2:08:31 PM UTC+1, Joey Eremondi wrote:
>>
>> Both int and float end up as a JS number at the end of the day, so 
>> definitely bounded. Defer to the JS spec?
>>
>
> http://www.w3schools.com/js/js_numbers.asp
>
> Says "Javascript numbers are always 64-bit floating point". 
>
> Which means a 52-bit mantissa, so ints are bit less than 64-bit... bit of 
> a bugger as that means where I have used a 64-bit for an object id, I 
> should really pass as a String and parse into a Data.Integer. Thanks.
>

Or just use a String for that case. I can treat all ids as opaque String 
values.

I can probably also user String for big decimals, since the aim would be to 
capture/display a decimal value such that binary rounding errors are not 
introduced, rather than to perform arithmetic with them.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, September 20, 2016 at 2:08:31 PM UTC+1, Joey Eremondi wrote:
>
> Both int and float end up as a JS number at the end of the day, so 
> definitely bounded. Defer to the JS spec?
>

http://www.w3schools.com/js/js_numbers.asp

Says "Javascript numbers are always 64-bit floating point". 

Which means a 52-bit mantissa, so ints are bit less than 64-bit... bit of a 
bugger as that means where I have used a 64-bit for an object id, I should 
really pass as a String and parse into a Data.Integer. Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread Janis Voigtländer
http://package.elm-lang.org/packages/javcasas/elm-integer/latest
​

2016-09-20 15:08 GMT+02:00 Joey Eremondi :

> Both int and float end up as a JS number at the end of the day, so
> definitely bounded. Defer to the JS spec?
>
> Not sure about bignum, there's definitely not language support, but there
> might be a library doing it somewhere, and if not, someone should write
> one!
>
> On Sep 20, 2016 10:03 PM, "'Rupert Smith' via Elm Discuss" <
> elm-discuss@googlegroups.com> wrote:
>
>> Is Int unbounded? I mean is it a 'big integer' implementation as per ML,
>> or is it 64-bit or soe other limit?
>>
>> What is the precision of a Float? Is it the same as 64-bit IEEE 754?
>>
>> Is there a 'big decimal' representation?
>>
>> The docs around the basics of syntax don't really cover this:
>> http://elm-lang.org/docs/syntax#type-annotations
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Some questions about types.

2016-09-20 Thread Joey Eremondi
Both int and float end up as a JS number at the end of the day, so
definitely bounded. Defer to the JS spec?

Not sure about bignum, there's definitely not language support, but there
might be a library doing it somewhere, and if not, someone should write
one!

On Sep 20, 2016 10:03 PM, "'Rupert Smith' via Elm Discuss" <
elm-discuss@googlegroups.com> wrote:

> Is Int unbounded? I mean is it a 'big integer' implementation as per ML,
> or is it 64-bit or soe other limit?
>
> What is the precision of a Float? Is it the same as 64-bit IEEE 754?
>
> Is there a 'big decimal' representation?
>
> The docs around the basics of syntax don't really cover this:
> http://elm-lang.org/docs/syntax#type-annotations
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Some questions about types.

2016-09-20 Thread 'Rupert Smith' via Elm Discuss
Is Int unbounded? I mean is it a 'big integer' implementation as per ML, or 
is it 64-bit or soe other limit?

What is the precision of a Float? Is it the same as 64-bit IEEE 754?

Is there a 'big decimal' representation?

The docs around the basics of syntax don't really cover this: 
http://elm-lang.org/docs/syntax#type-annotations

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.