We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bcbed56 + 0f527db commit 829251bCopy full SHA for 829251b
src/bfloat16.jl
@@ -5,7 +5,7 @@ import Base: isfinite, isnan, precision, iszero, eps,
5
exponent_one, exponent_half, leading_zeros,
6
signbit, exponent, significand, frexp, ldexp,
7
round, Int16, Int32, Int64,
8
- +, -, *, /, ^, ==, <, <=, >=, >, !=, inv,
+ +, -, *, /, ^, ==, <, <=, inv,
9
abs, abs2, uabs, sqrt, cbrt,
10
exp, exp2, exp10, expm1,
11
log, log2, log10, log1p,
@@ -269,8 +269,9 @@ function ==(x::BFloat16, y::BFloat16)
269
return ix == iy
270
end
271
272
-for op in (:<, :<=, :>, :>=, :!=)
273
- @eval ($op)(a::BFloat16, b::BFloat16) = ($op)(Float32(a), Float32(b))
+<(a::BFloat16, b::BFloat16) = Float32(a) < Float32(b)
+@static if VERSION < v"1.8"
274
+ <=(a::BFloat16, b::BFloat16) = Float32(a) <= Float32(b)
275
276
277
Base.widen(::Type{BFloat16}) = Float32
0 commit comments