Per the docs, "on a typical R platform the smallest positive double is about 5e-324
." Given a double vector with values above, near, and below this limit:
library(tibble)
small_vec <- c(4e-300, 4e-324, 4e-350)
small_df <- data.frame(x = small_vec)
small_tibble <- tibble(x = small_vec)
Printing small_vec
and small_df
give about what I'd expect:
small_vec
#> [1] 4.000000e-300 4.940656e-324 0.000000e+00
small_df
#> x
#> 1 4.000000e-300
#> 2 4.940656e-324
#> 3 0.000000e+00
The second value isn't quite right, which I vaguely understand is due to floating point weirdness. The third number underflows to 0
. Fine. But printing as a tibble,
small_tibble
#> # A tibble: 3 × 1
#> x
#> <dbl>
#> 1 4 e-300
#> 2 Inf.e-324
#> 3 0
Created on 2022-10-19 with reprex v2.0.2
I'm thrown by Inf.e-324
-- both the idea of Inf
with an exponent, and the decimal point. What does this signify? Or is it possibly a bug in the tibble package?