Skip to content

Error from very large & small numbers #2

@mcabbott

Description

@mcabbott
julia> [1.0876169274012003e-296
        2.8590377617020347e-194
        3.983626798390652e188
        6.198941844352751e306 ]
4-element Vector{Float64}:
 1.0876169274012003e-296  #
 2.8590377617020347e-194  #
 3.983626798390652e188    #
 6.198941844352751e306    #  Error showing value of type Vector{Float64}:
ERROR: InexactError: Int64(Inf)
Stacktrace:
  [1] Int64
    @ ./float.jl:994 [inlined]
  [2] convert
    @ ./number.jl:7 [inlined]
  [3] _round_convert
    @ ./rounding.jl:480 [inlined]
  [4] round
    @ ./rounding.jl:479 [inlined]
  [5] round(::Type{Int64}, x::Float64)
    @ Base ./rounding.jl:477
  [6] print_matrix_row(io::IOContext{…}, X::AbstractVector, A::Vector{…}, i::Int64, cols::Vector{…}, ::Tuple{…}, idxlast::Int64)
    @ InTheRed ~/.julia/dev/InTheRed/src/InTheRed.jl:367
  [7] _print_matrix(io::IOContext{…}, X::AbstractVecOrMat, pre::String, sep::Tuple{…}, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64, rowsA::UnitRange{…}, colsA::UnitRange{…})
    @ Base ./arrayshow.jl:213
  [8] print_matrix(io::IOContext{…}, X::AbstractVector{…}, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64)
    @ InTheRed ~/.julia/dev/InTheRed/src/InTheRed.jl:329
  [9] print_matrix
    @ ~/.julia/dev/InTheRed/src/InTheRed.jl:327 [inlined]
 [10] print_array
    @ ./arrayshow.jl:358 [inlined]
 [11] show(io::IOContext{Base.TTY}, ::MIME{Symbol("text/plain")}, X::Vector{Float64})
    @ Base ./arrayshow.jl:399

julia> big.(ans)
4-element Vector{BigFloat}:
 1.087616927401200285018319568545486814502889178064027059196542505850344809969077e-296  #
 2.859037761702034670545107230554641025787116350396484878711277131613590027864639e-194  #
 3.983626798390652253889328433303519879822437273521670606883129696293955010257162e+188  #
 6.198941844352751018891366080023220524260710929766619002117628826897026284271671e+306  #    ┝━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions