Skip to content

Commit 04e2028

Browse files
authored
Merge pull request #40245 from oscardssmith/oscardssmith-bigfloat-to-float16
Make `Float16(::BigFloat)` go through `Float64`
2 parents 0700bea + 323b5b4 commit 04e2028

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/mpfr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ Float32(x::BigFloat, r::MPFRRoundingMode=ROUNDING_MODE[]) =
339339
Float32(x::BigFloat, r::RoundingMode) = Float32(x, convert(MPFRRoundingMode, r))
340340

341341
# TODO: avoid double rounding
342-
Float16(x::BigFloat) = Float16(Float32(x))
342+
Float16(x::BigFloat) = Float16(Float64(x))
343343

344344
promote_rule(::Type{BigFloat}, ::Type{<:Real}) = BigFloat
345345
promote_rule(::Type{BigInt}, ::Type{<:AbstractFloat}) = BigFloat

0 commit comments

Comments
 (0)