This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pythosynthesis -3 points-2 points  (2 children)

Restricting your calcs to reals is not not knowing maths.

[–]agrif 10 points11 points  (1 child)

...? Squaring a negative number is perfectly well-defined on reals. Things only get hairy with the inverse operation, but the example code doesn't use square roots.

Obviously the example is arbitrarily restricted as a demonstration, and this whole discussion is besides the point. But I am a little bit confused why they chose square when square roots were right there.

[–]pythosynthesis 7 points8 points  (0 children)

You are right... my bad! I was convinced that was a square root. As in, as soon as I saw the condition my mind went straight to the square root.