And

julia> parse("1.*80")
:(1 .* 80)
julia> parse("1.0*80")
:(1.0 * 80)


On Wednesday, October 19, 2016 at 1:36:00 PM UTC+2, Michele Zaffalon wrote:
>
> I should have realized that:
>
> julia> promote(1., 80)
> (1.0,80.0)
> julia> 80*1.
> 80.0
>
> Thank you.
>
> On Wednesday, October 19, 2016 at 1:30:27 PM UTC+2, Mauro wrote:
>>
>> On Wed, 2016-10-19 at 13:11, Michele Zaffalon <michele....@gmail.com> 
>> wrote: 
>> > I am confused by the type of the result of `1.*80`, which is `Int64`, 
>> despite 
>> > the fact that `1.` is `Float64`, and that `Float64(1)*80` is a 
>> `Float64`: 
>>
>> No this is parsed as 1 .* 80.  Try 1.0*80 
>>
>> > julia> typeof(1.), typeof(80), typeof(1.*80), typeof(Float64(1.)*80) 
>> > (Float64,Int64,Int64,Float64) 
>> > 
>> > Does it have to do with the fact that both 1 and 80 have an exact 
>> Float64 
>> > representation? 
>> > 
>> > julia> bits(1.) 
>> > "0011111111110000000000000000000000000000000000000000000000000000" 
>> > 
>> > julia> bits(80.) 
>> > "0100000001010100000000000000000000000000000000000000000000000000" 
>> > 
>> > 
>> > Thank you, 
>> > michele 
>>
>

Reply via email to