QuantEcon / CompEcon.jl

Julia versions of the CompEcon routines by Miranda and Fackler.
BSD 3-Clause "New" or "Revised" License
47 stars 27 forks source link

Fix small bug related to floating point conversion #4

Closed davidanthoff closed 9 years ago

sglyon commented 9 years ago

@davidanthoff, thanks for sending this.

I forgot that writing it this way would break on 0.3 (the current code is the correct syntax on 0.4).

I actually think the easiest thing to do would be just to drop the manual conversion altogether and let Julia take care of it for us.

This example works with julia 3 and 4 (on my machine):

type Foo
    x::Float64
end

x = 3
println(typeof(x))  # Int64
Foo(x)  # Foo(3.0) -- automatic conversion to Float64

Would you mind just deleting that line?

davidanthoff commented 9 years ago

Done!

sglyon commented 9 years ago

Excellent thanks!