re-enable printf

This commit is contained in:
Mike J Innes 2018-02-12 15:05:09 +00:00
parent 334ae9e1cb
commit f22cfb5b43
2 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,7 @@ for f in :[isinf, isnan, isfinite].args
@eval Base.$f(x::TrackedReal) = Base.$f(data(x))
end
# Base.Printf.fix_dec(x::TrackedReal, n::Int) = Base.Printf.fix_dec(data(x), n)
Base.Printf.fix_dec(x::TrackedReal, n::Int) = Base.Printf.fix_dec(data(x), n)
Base.promote_rule(::Type{TrackedReal{S}},::Type{T}) where {S,T} =
TrackedReal{promote_type(S,T)}

View File

@ -67,4 +67,6 @@ end
@test x.grad == [8]
end
@test @sprintf("%.2f", sum(param([1,2,3]))) == "6.00"
end #testset