You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>macrodecimal(ex)
trans!(e::Real) = :(Decimal($e))
trans!(e::Expr) =beginfor (i,a) inenumerate(e.args)
a isa Integer &&continue
a isa Real && (e.args[i] =Decimal(a))
a isa Expr &&trans!(a)
end
ex
end
:(number($(trans!(ex))))
end@decimal (macro with 1 method)
julia>100*1.1576115.75999999999999
julia>@decimal100*1.1576115.76
The text was updated successfully, but these errors were encountered:
This implementation is very rough, but it works well enough to explain my concept.
That is, I expect the expression to be decimalized simply by prefixing it with @decimal.
Would the following macros be useful?
The text was updated successfully, but these errors were encountered: