3 ms·
You don't want to start a religious war between the people who believe zero is special, and the ones who believe it should throw an error if you pass a string,
by DonHopkins 8y ago
You don't want to start a religious war between the people who believe zero is special, and the ones who believe it should throw an error if you pass a string, and the people who believe it should attempt to convert the string to an integer, and the people who believe you should either round or truncate when the parameter is a floating point number, and the people who disagree about which direction to round, and the people who can't agree whether you should truncate towards zero or negative infinity.
- e12e 8y ago> should either round or truncate when the parameter is a floating point number Isn't the parameter always floating point in Javascript? (which does mean a package like isOdd will have to incorporate some level of mysticism...)
- marcosdumay 8y agoLet the fight begin! It goes well with some popcorn. I can understand how fundamental education teachers don't grasp modern Algebrism and believe that Math is formed by fundamental, sacred definitions. But programmers ought to know better.
- pcmaffey 8y agoAnd my favorite case - that zero is false. (!!0)