Sha256: c6eaa5bfedc48e052237404d7478973695d76b1c49b7c0cd2e80e74d3c2b6fb2
Contents?: true
Size: 603 Bytes
Versions: 43
Compression:
Stored size: 603 Bytes
Contents
// JavaScript Lint (http://www.JavaScriptLint.com/) // // This function is supposed to find the difference between two numbers, // but it has some bugs! (And JavaScript Lint can help you find them!) /*jsl:option explicit*/ function subtract(x,y) { // optimize for equal values if (x = y) { return 0; } // don't allow negative return value if (x < x) { return null; } // optimize for some common subtractions switch (y) { case 0: z = x; case 1: z = --x; return z; } // finally, resort to actual subtraction! return; x-y; }
Version data entries
43 entries across 43 versions & 1 rubygems