Experience-Monks / math-as-code

a cheat-sheet for mathematical notation in code form
MIT License
14.98k stars 1.07k forks source link

sqrt(x^2) is not equal to x #42

Closed asmeurer closed 8 years ago

asmeurer commented 8 years ago

The readme says sqrt(x^2) = x. But this is not true in general (take x=-1). In general it's equal to +/- x.

It probably should say sqrt(x)^2 = x, which is always true, and can be taken as a "definition" of the square root.

asmeurer commented 8 years ago

PR at https://github.com/Jam3/math-as-code/pull/43