A "random()" function which can probably be useful from time to time. It requires at least one entry as a boundary and returns a random integer between it and the second one (~ 0 if you used just one entry).
There is still one thing that bugs me: even though you are able to use any positive and negative number as an input, it currently just calculates the result correctly if none of them got floating points. I know there would be the possibility to check if one contains some (=> c = (a%1!=0)||(b%1!=0) ), but unfortunately I ran out of space. Since there seem to be the potential saving some bytes, e.g. like the condition for the second parameter check, there is hopefully the chance to enhance it. It would be great if you have an advice to shorten the code or know or nice way of determining the amount of floats :)
- thanks @tsaniel: pointing to keeping the scope, not counting the function name and regarding parantheses (140->112)
@xpansive: Yeah unfortunately it doesn't work for them :(
@tsaniel: Wow, I definately still have a lot to learn about js. Didn't knew the methods Math.max() and Math.min() or even the way to call it before "with(Math)" to avoid repetition. It even deals with floating points - just not in the way I thought. Using "11.5" as a value returns values from 0 - 12, instead of 0.0 to 11.5. If you don't mind - I will use your code further to dig into this (^_^) (112->74)