mirror of
https://github.com/JuliaLang/julia.git
synced 2026-05-28 03:10:33 +08:00
Implement inv_fast using div_fast
This commit is contained in:
@@ -172,6 +172,8 @@ max_fast(x::T, y::T) where {T<:FloatTypes} = max_float_fast(x, y)
|
||||
min_fast(x::T, y::T) where {T<:FloatTypes} = min_float_fast(x, y)
|
||||
minmax_fast(x::T, y::T) where {T<:FloatTypes} = (min_fast(x, y), max_fast(x, y))
|
||||
|
||||
inv_fast(x::T) where {T<:FloatTypes} = div_fast(one(T), x)
|
||||
|
||||
@fastmath begin
|
||||
cmp_fast(x::T, y::T) where {T<:FloatTypes} = ifelse(x==y, 0, ifelse(x<y, -1, +1))
|
||||
log_fast(b::T, x::T) where {T<:FloatTypes} = log_fast(x)/log_fast(b)
|
||||
|
||||
Reference in New Issue
Block a user