JuliaMath / DoubleDouble.jl

Extended precision arithmetic for Julia (deprecated)
Other
26 stars 16 forks source link

DoubleDouble Cannot Multiply Ints #16

Closed ChrisRackauckas closed 8 years ago

ChrisRackauckas commented 8 years ago

Example:

julia> Double(2)*2
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type DoubleDouble.Double{Float64}
This may have arisen from a call to the constructor DoubleDouble.Double{Float64}(...),
since type constructors fall back to convert methods.
 in *(::DoubleDouble.Double{Float64}, ::Int64) at ./promotion.jl:191
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:62
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:46
dpsanders commented 8 years ago

Could you try the branch convert_reals, please? It has some ambiguity warnings though.

dpsanders commented 8 years ago

If you feel like cleaning it up, that would be great.

ChrisRackauckas commented 8 years ago

Seems to work. But then exp isn't defined for DoubleDouble.

dpsanders commented 8 years ago

Sure, that (i.e. elementary functions such as exp) is much, much harder to implement, except by wrapping it in a BigFloat (cf. CRLibm.jl), which defeats the point of having a DoubleDouble type. If you need this, you should check out ArbFloats.jl.