Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions base/ryu/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,9 @@ function pow5invsplit_lookup end
for T in (Float64, Float32, Float16)
e2_max = exponent_max(T) - precision(T) - 2
i_max = log10pow2(e2_max)
table = Any[pow5invsplit(T, i) for i = 0:i_max]
@eval pow5invsplit_lookup(::Type{$T}, i) = @inbounds($table[i+1])
table_sym = Symbol("pow5invsplit_table_", string(T))
@eval const $table_sym = Tuple(Any[pow5invsplit($T, i) for i = 0:$i_max])
@eval pow5invsplit_lookup(::Type{$T}, i) = @inbounds($table_sym[i+1])
end


Expand All @@ -382,8 +383,9 @@ function pow5split_lookup end
for T in (Float64, Float32, Float16)
e2_min = 1 - exponent_bias(T) - significand_bits(T) - 2
i_max = 1 - e2_min - log10pow5(-e2_min)
table = Any[pow5split(T, i) for i = 0:i_max]
@eval pow5split_lookup(::Type{$T}, i) = @inbounds($table[i+1])
table_sym = Symbol("pow5split_table_", string(T))
@eval const $table_sym = Tuple(Any[pow5split($T, i) for i = 0:$i_max])
@eval pow5split_lookup(::Type{$T}, i) = @inbounds($table_sym[i+1])
end

const DIGIT_TABLE = UInt8[
Expand Down