Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • \$\begingroup\$ I'm also going to assume that the user didn't enter something funny like NaN. \$\endgroup\$ Commented Jan 4, 2014 at 18:02
  • \$\begingroup\$ In my opinion, using functions that don't exist is cheating. Just change this into JavaScript code, and replace int(r) with ~~r. \$\endgroup\$ Commented Jan 4, 2014 at 18:43
  • \$\begingroup\$ @xfix No! I refuse to support the use of an un-typed and classless language! Bah, humbug! \$\endgroup\$ Commented Jan 4, 2014 at 18:46
  • \$\begingroup\$ It's not that you use types or classes here. Also, you have definitely too many parens (return doesn't need parenthesis, and && has bigger precedence than both parenthesis groups). \$\endgroup\$ Commented Jan 4, 2014 at 18:48
  • 1
    \$\begingroup\$ @xfix Fine, you win, but may the records show that I still conscientiously object to the use of JavaScript as a serious programming languages. \$\endgroup\$ Commented Jan 4, 2014 at 19:23