Math.extend is submitted!
Your script is now in the approval queue. After a quick review we will notify you of the script's status by email. If everything's alright, we'll publish your work to the site and rss feed. Otherwise, we'll send you the email explaining what seems questionable. In that case, reply to the email whenever we should review the script again.
Also, don't hesitate to discuss things if you feel that our reasons are unfair. We are real folk, and we don't like bureaucracy. : )
Thank you for your contribution!
1
This JavaScript extension for Prototype.js aims to provide more tools and functions for math-related development. It extends Math native object, Number and Array native classes.
Latest version: 0.2.2 released on 2008-07-11.
var myNumber = -12;
myNumber.isOdd(); // -> false
(42602).isEven(); // -> true
myNumber.isInteger(); // -> true
(3).isPrime(); // -> returns true, 3 is a prime
(4).isPrime(); // -> returns false, 4 is not a prime
[1,2,3,4,5].shuffle(); // -> shuffles & returns new array
Math.stdDev([78, 88, 93, 67, 89, 75, 91]); // -> approx. 9
- Website:
-
Math.extend
- Author:
-
Laurent Fortin
- Size:
- 4.7 KB
- Last modified:
- 07/11/2008
- License:
-
MIT
- Tags:
- syntactic sugar
- Rating:
-
5
(5/5 from 1 vote)
- Your rating:
-
0
Not yet rated
- Please sign in or register to rate this script
- You can't rate your own script.