This repository was archived by the owner on Mar 1, 2024. It is now read-only.
Description
intv = trunc (Integer, rax)
julia> using Formatting
julia> fmt (FormatSpec (" 15.6f" ), 1e5 ) # OK
" 100000.000000"
julia> fmt (FormatSpec (" 15.6f" ), 1e10 ) # OK, even the width is too small
" 10000000000.000000"
julia> fmt (FormatSpec (" 15.6f" ), 1e20 ) # Error, the float is too large to be represented by Int64
ERROR: InexactError: trunc (Int64, 1.0e20 )
Stacktrace:
[1 ] trunc
@ .\ float. jl: 716 [inlined]
[2 ] trunc
@ .\ float. jl: 291 [inlined]
[3 ] _pfmt_f (out:: IOBuffer , fs:: FormatSpec , x:: Float64 )
@ Formatting ~ \ . julia\ packages\ Formatting\ BwWBf\ src\ fmtcore. jl: 176
[4 ] printfmt (io:: IOBuffer , fs:: FormatSpec , x:: Float64 )
@ Formatting ~ \ . julia\ packages\ Formatting\ BwWBf\ src\ fmtspec. jl: 190
[5 ] sprint (:: Function , :: FormatSpec , :: Vararg{Any, N} where N; context:: Nothing , sizehint:: Int64 )
@ Base .\ strings\ io. jl: 105
[6 ] sprint
@ .\ strings\ io. jl: 101 [inlined]
[7 ] fmt (fs:: FormatSpec , x:: Float64 )
@ Formatting ~ \ . julia\ packages\ Formatting\ BwWBf\ src\ fmtspec. jl: 205
[8 ] top- level scope
@ REPL[16 ]: 1
This could be fixed by changing Integer to BigInt.
Reactions are currently unavailable
Formatting.jl/src/fmtcore.jl
Line 176 in e4c9f60
This could be fixed by changing
IntegertoBigInt.