Skip to content

Comment on Ask HN: What is -2^2?

Comments

Somewhat related, in the Io language, I was surprised to find that the expression "-23 abs" evaluates to "-23" not +23. The language desugars the expression to "0-(23 abs)". I think what threw me was the fact that Io uses a space rather than a dot for member selectors. No one would be surprised that C++ evaluates "-numObj.abs()" that way.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.