On Tue, Apr 5, 2016 at 11:05 AM, Didier Verna <did...@didierverna.net> wrote:
> Erik Schnetter <schnet...@gmail.com> wrote:
>
>> The literal `1` has type `Int`.  The promotion rules for `Int8` and
>> `Int` state that, before the addition, `Int8` is converted to `Int`.
>> (On your system, it seems that `Int` is `Int64`.)
>
>   OK, so indeed, there's modular arithmetics for the non native
>   representations as well. It's just that litterals are neither
>   overloaded, nor implicitly transtyped. I see, thanks.

Some mathematical constants (e.g. pi) automatically adapt to the
environment where they are used, defaulting to Float64. Literals,
however, do not -- they have a specific type.

-erik

-- 
Erik Schnetter <schnet...@gmail.com>
http://www.perimeterinstitute.ca/personal/eschnetter/

Reply via email to