1
0
Fork 0
forked from 0x2620/oxjs

in documentation use foo, not <code>foo</code>

This commit is contained in:
rolux 2012-06-02 13:06:44 +02:00
commit 73fa856900
16 changed files with 89 additions and 105 deletions

View file

@ -2,7 +2,7 @@
/*@
Ox.asinh <f> Inverse hyperbolic sine
Missing from <code>Math</code>.
Missing from `Math`.
> Ox.asinh(0)
0
@*/
@ -12,7 +12,7 @@ Ox.asinh = function(x) {
/*@
Ox.deg <f> Takes radians, returns degrees
Missing from <code>Math</code>.
Missing from `Math`.
> Ox.deg(2 * Math.PI)
360
@*/
@ -22,10 +22,9 @@ Ox.deg = function(rad) {
/*@
Ox.divideInt <f> Divides a number by another and returns an array of integers
<code>Ox.divideInt(num, by)</code> returns a sorted array of integers that
has a sum of <code>num</code>, a length of <code>by</code>, a minimum of
<code>Math.floor(num / by)</code> and a maximum of
<code>Math.ceil(num / by)</code>.
`Ox.divideInt(num, by)` returns a sorted array of integers that has a sum of
`num`, a length of `by`, a minimum of `Math.floor(num / by)` and a maximum
of `Math.ceil(num / by)`.
> Ox.divideInt(100, 3)
[33, 33, 34]
> Ox.divideInt(100, 6)
@ -42,11 +41,11 @@ Ox.divideInt = function(number, by) {
/*@
Ox.limit <f> Limits a number by a given mininum and maximum
<code>Ox.limit(num, min, max)</code> is a shorthand for
<code>Math.min(Math.max(num, min), max)</code>
(num) -> <n> <code>num</code>
(num, max) -> <n> <code>Math.max(num, max)</code>
(num, min, max) -> <n> <code>Math.min(Math.max(num, min), max)</code>
`Ox.limit(num, min, max)` is a shorthand for `Math.min(Math.max(num, min),
max)`
(num) -> <n> `num`
(num, max) -> <n> `Math.max(num, max)`
(num, min, max) -> <n> `Math.min(Math.max(num, min), max)`
num <n> number
min <n> minimum
max <n> maximum
@ -68,7 +67,7 @@ Ox.limit = function(/*number[[, min], max]*/) {
/*@
Ox.log <f> Returns the logarithm of a given number to a given base
Missing from <code>Math</code>.
Missing from `Math`.
> Ox.log(100, 10)
2
> Ox.log(Math.E)
@ -80,8 +79,7 @@ Ox.log = function(number, base) {
/*@
Ox.mod <f> Modulo function
Unlike <code>-1 % 10</code>, which returns <code>-1</code>,
<code>Ox.mod(-1, 10)</code> returns <code>9</code>.
Unlike `-1 % 10`, which returns `-1`, `Ox.mod(-1, 10)` returns `9`.
> Ox.mod(11, 10)
1
> Ox.mod(-11, 10)
@ -93,7 +91,7 @@ Ox.mod = function(number, by) {
/*@
Ox.rad <f> Takes degrees, returns radians
Missing from <code>Math</code>.
Missing from `Math`.
> Ox.rad(360)
2 * Math.PI
@*/
@ -135,7 +133,7 @@ Ox.round = function(number, decimals) {
/*@
Ox.sinh <f> Hyperbolic sine
Missing from <code>Math</code>.
Missing from `Math`.
> Ox.sinh(0)
0
@*/