var() is not equal to sd()^2 in R Mathematically, it is evident that var = sd^2 (or var^0.5 = sd), but R seems to answer TRUE for the latter and FALSE for the former.
To my knowledge, both var() and sd() function use n-1 for degree of freedom.
What would be the problem?
data <- c(20, 20, 30, 20, 16, 13, 20)

var(data)^0.5 == sd(data)
var(data) == sd(data)^2


Check the differences between those quantities. They are likely to be small.
Computers are funky about how they store long decimals.
