bug in number reading?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bug in number reading?

Jason Dusek
  Maybe I'm missing something, but this doesn't seem right...

--
_jsn


 :; ghc -e '10e4'

<interactive>:1:0:
    Warning: Defaulting the following constraint(s) to type `Double'
             `Fractional a' arising from a use of `it' at <interactive>:1:0-3
    In the first argument of `print', namely `it'
    In the expression: print it
    In a stmt of a 'do' expression: print it
100000.0
it :: forall t. (Fractional t) => t
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: bug in number reading?

Brandon S Allbery KF8NH
On 2008 Sep 28, at 18:42, Jason Dusek wrote:

>  Maybe I'm missing something, but this doesn't seem right...
>
> :; ghc -e '10e4'
>
> <interactive>:1:0:
>    Warning: Defaulting the following constraint(s) to type `Double'
>             `Fractional a' arising from a use of `it' at  
> <interactive>:1:0-3
>    In the first argument of `print', namely `it'
>    In the expression: print it
>    In a stmt of a 'do' expression: print it
> 100000.0
> it :: forall t. (Fractional t) =>

Looks right to me.  Remember that the translation of that is 10 * 10^4.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [hidden email]
system administrator [openafs,heimdal,too many hats] [hidden email]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: bug in number reading?

Bugzilla from alfonso.acosta@gmail.com
In reply to this post by Jason Dusek
>  :; ghc -e '10e4'

10e4 = 10*10^4 = 10^5 = 1e5 = 100000.0

> 100000.0

It seems to be OK.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: bug in number reading?

Jason Dusek
In reply to this post by Brandon S Allbery KF8NH
Brandon S. Allbery KF8NH <[hidden email]> wrote:

> Jason Dusek wrote:
>>
>>  Maybe I'm missing something, but this doesn't seem right...
>>
>> :; ghc -e '10e4'
>>
>> <interactive>:1:0:
>>   Warning: Defaulting the following constraint(s) to type `Double'
>>            `Fractional a' arising from a use of `it' at
>> <interactive>:1:0-3
>>   In the first argument of `print', namely `it'
>>   In the expression: print it
>>   In a stmt of a 'do' expression: print it
>> 100000.0
>> it :: forall t. (Fractional t) =>
>
> Looks right to me.  Remember that the translation of that is 10 * 10^4.

  Oh, right.

--
_jsn
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: bug in number reading?

Henning Thielemann
In reply to this post by Brandon S Allbery KF8NH

On Sun, 28 Sep 2008, Brandon S. Allbery KF8NH wrote:

> On 2008 Sep 28, at 18:42, Jason Dusek wrote:
>> Maybe I'm missing something, but this doesn't seem right...
>>
>> :; ghc -e '10e4'
>>
>> <interactive>:1:0:
>>   Warning: Defaulting the following constraint(s) to type `Double'
>>            `Fractional a' arising from a use of `it' at <interactive>:1:0-3
>>   In the first argument of `print', namely `it'
>>   In the expression: print it
>>   In a stmt of a 'do' expression: print it
>> 100000.0
>> it :: forall t. (Fractional t) =>
>
> Looks right to me.  Remember that the translation of that is 10 * 10^4.

Btw. is there a reason why exponential notation always requires Fractional
not Num? I guess 10e4 is translated to 10 * 10^^4, not 10 * 10^4, but the
latter one would be more convenient, and (^^) could be used only for
negative exponents.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe