I agree that you were onto something -- not what you first thought, though.
The docs tell me to expect typemax(Int8)+typemax(Int8) yields Int(254)
<aside: Int16(254) would be a better choice imho>
Running v0.4-dev+6253 : Int8(127) + Int8(127) ] yields Int8(-2)


On Tuesday, August 4, 2015 at 12:26:46 PM UTC-4, Sisyphuss wrote:
>
> @Jeffrey, I don't quite get your idea. You agree with me?
>
> From your example, the document has claimed something it hasn't done?
>
>
>
> On Tuesday, August 4, 2015 at 5:34:51 AM UTC+2, Jeffrey Sarnoff wrote:
>>
>>
>> (cont.)
>> after reading that, I did not expect this:
>>
>>>
>>> ```julia
>>>
>>  
>>
>>> julia> a=typemax(Int8)+typemax(Int8)
>>> -2
>>>
>>> julia> a=typemax(Int8)*typemax(Int8)
>>> 1
>>>
>>> julia> a=typemin(Int8)-typemax(Int8)
>>> 1
>>> ```
>>>
>>>
>>> ```
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Monday, August 3, 2015 at 7:42:03 PM UTC-4, Sisyphuss wrote:
>>>>
>>>> "integer addition... operands are promoted to Int or UInt from 
>>>> narrower integer types" (
>>>> http://docs.julialang.org/en/latest/manual/integers-and-floating-point-numbers/
>>>> )
>>>>
>>>> "These catch-all rules first promote all operands to a common type " (
>>>> http://docs.julialang.org/en/latest/manual/conversion-and-promotion/#man-conversion-and-promotion
>>>> )
>>>>
>>>> `Int8` is definitely not a subclass of `Int`, do this two assertions 
>>>> contradict to each other?
>>>>
>>>

Reply via email to