knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
is probably the most famous FAQ, so it deserves its own 📦 to help you 🕵️ the confusion of
0.3 + 0.6 == 0.9 sqrt(2)^2 == 2
This wikipedia article
is a good introduction to the Double-precision floating-point format, but in short
double
(what we call numeric
in R) are encoded in 64 bits:
From github:
devtools::install_github( "ThinkR-open/seven31" )
reveal
🔍 the binary representation of numbers. It takes a variadic number of arguments
and shows their representation. On a 🖍 compatible environment, you get a nice colored output:
compare
shows the differences. On 🖍 compatible environments, the bits that differ between the two numbers
are highlighted with 🔴 background.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.