julia> sin(x) = println("Hello, $x")
sin (generic function with 1 method)
julia> sin("World")
Hello, World
julia> @fastmath sin("World")
ERROR: MethodError: no method matching sin(::String)
Closest candidates are:
sin(::BigFloat) at mpfr.jl:637
sin(::Complex{Float16}) at math.jl:951
sin(::Float16) at math.jl:950
...
Stacktrace:
[1] sin_fast(::String) at ./fastmath.jl:332
Maybe the docstring should mention how @fastmath rewrites syntactically, as there's less nonsensical scenario's where this might trip up user code (only defining sin on custom number types, adding specialized methods, etc).
Maybe the docstring should mention how
@fastmath
rewrites syntactically, as there's less nonsensical scenario's where this might trip up user code (only definingsin
on custom number types, adding specialized methods, etc).