Julia@sprintf宏在“0”中的工作方式似乎有所不同;e‘&引用;f";,及;d";格式参数

Julia@sprintf宏在“0”中的工作方式似乎有所不同;e‘&引用;f";,及;d";格式参数,julia,Julia,我使用的是Julia 1.0.2。Julia@sprintf宏似乎会在“e”格式类型上产生错误,而“f”和“d”格式类型对于相同的数字工作正常。见以下示例: julia> VERSION v"1.0.2" julia> using Printf # Note that this number works fine with "e" format. julia> @sprintf "%0.4e" 323232329999999329999999 "3.2323e+23" #

我使用的是Julia 1.0.2。Julia
@sprintf
宏似乎会在“e”格式类型上产生错误,而“f”和“d”格式类型对于相同的数字工作正常。见以下示例:

julia> VERSION
v"1.0.2"

julia> using Printf
# Note that this number works fine with "e" format.
julia> @sprintf "%0.4e" 323232329999999329999999
"3.2323e+23"

# Adding the digit 1 to end of above number causes error with "e" format.
julia> @sprintf "%0.4e" 3232323299999993299999991
ERROR: BoundsError: attempt to access 20-element Array{UInt64,1} at index [21]

# The same number works with the "d" format.
julia> @sprintf "%0.4d" 3232323299999993299999991
"3232323299999993299999991"

# In addition, the same number works with the "f" format.
julia> @sprintf "%0.4f" 3232323299999993299999991
"3232323299999993299999991.0000"

# EDIT: I found a workaround that solves this case, use float():
# Here is the same error as above:
julia> @sprintf "%0.4e" 3232323299999993299999991
ERROR: BoundsError: attempt to access 20-element Array{UInt64,1} at index [21]

# Here is the workaround using the float() function:
julia> @sprintf "%0.4e" float(3232323299999993299999991)
"3.2323e+24"
我在
@printf
宏中发现了类似的行为

对于我不知道的“e”格式使用
@sprintf
宏是否有上限?这不适用于“f”或“d”格式类型