more docs
This commit is contained in:
parent
aba122c3e6
commit
823e9a6498
21
docs/math.md
21
docs/math.md
@ -18,11 +18,12 @@ Same as in C++.
|
|||||||
| 10 | `&&` |
|
| 10 | `&&` |
|
||||||
| 11<br/>lowest | `\|\|` |
|
| 11<br/>lowest | `\|\|` |
|
||||||
|
|
||||||
(NI)
|
(NI)
|
||||||
: not yet implemented.
|
: not yet implemented.
|
||||||
|
|
||||||
(1)
|
(1)
|
||||||
: Shuttle operator: `a <=> b` returns 0 if a == b, negative Int if a < b and positive Int otherwise. It is necessary to override shuttle operator to make a class comparable.
|
: Shuttle operator: `a <=> b` returns 0 if a == b, negative Int if a < b and positive Int otherwise. It is necessary to
|
||||||
|
override shuttle operator to make a class comparable.
|
||||||
|
|
||||||
## Operators
|
## Operators
|
||||||
|
|
||||||
@ -42,15 +43,14 @@ but:
|
|||||||
The following functions return its argument if it is `Int`,
|
The following functions return its argument if it is `Int`,
|
||||||
or transformed `Real` otherwise.
|
or transformed `Real` otherwise.
|
||||||
|
|
||||||
| name | description |
|
| name | description |
|
||||||
|----------|--------------------------------------------------------|
|
|----------------|--------------------------------------------------------|
|
||||||
| floor(x) | Computes the largest integer value not greater than x |
|
| floor(x) | Computes the largest integer value not greater than x |
|
||||||
| ceil(x) | Computes the least integer value value not less than x |
|
| ceil(x) | Computes the least integer value value not less than x |
|
||||||
| round(x) | Rounds x |
|
| round(x) | Rounds x |
|
||||||
| abs(x) | absolute value, Int for integer x, Real otherwise |
|
| x.roundToInt() | shortcut to `round(x).toInt()` |
|
||||||
| | |
|
|
||||||
|
|
||||||
## Mathematical functions
|
## Lyng math functions
|
||||||
|
|
||||||
| name | meaning |
|
| name | meaning |
|
||||||
|-----------|------------------------------------------------------|
|
|-----------|------------------------------------------------------|
|
||||||
@ -73,7 +73,6 @@ or transformed `Real` otherwise.
|
|||||||
| sqrt(x) | $ \sqrt {x}$ |
|
| sqrt(x) | $ \sqrt {x}$ |
|
||||||
| abs(x) | absolute value of x. Int if x is Int, Real otherwise |
|
| abs(x) | absolute value of x. Int if x is Int, Real otherwise |
|
||||||
|
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
assert( sin(π/2) == 1.0)
|
assert( sin(π/2) == 1.0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user