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.
1 parent 2811afa commit 7cf9374Copy full SHA for 7cf9374
src/bfloat16.jl
@@ -222,6 +222,10 @@ else
222
end
223
224
225
+# BigFloat conversion
226
+BFloat16(x::BigFloat) = BFloat16(Float32(x))
227
+Base.BigFloat(x::BFloat16) = BigFloat(Float32(x))
228
+
229
# Basic arithmetic
230
if llvm_arithmetic
231
+(x::T, y::T) where {T<:BFloat16} = Base.add_float(x, y)
test/runtests.jl
@@ -27,6 +27,8 @@ end
27
@test Float64(BFloat16(10)) == 10.0
28
@test Int32(BFloat16(10)) == Int32(10)
29
@test Int64(BFloat16(10)) == Int64(10)
30
+ @test BFloat16(BigFloat(1)) == BFloat16(1)
31
+ @test BigFloat(BFloat16(1)) == BigFloat(1)
32
33
34
@testset "abi" begin
0 commit comments