mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
Update docs
This commit is contained in:
parent
bcf9c2bd1f
commit
7b0c9408c1
@ -27,18 +27,18 @@ Num range : @Num range
|
||||
##
|
||||
## Some languages have a unary `-` operator (for example, `-(a + b)`), but Roc does not. If you want to negate a number, calling this function is the way to do it!
|
||||
##
|
||||
## > Num.negate 5
|
||||
## > Num.neg 5
|
||||
##
|
||||
## > Num.negate -2.5
|
||||
## > Num.neg -2.5
|
||||
##
|
||||
## > Num.negate 0
|
||||
## > Num.neg 0
|
||||
##
|
||||
## > Num.negate 0.0
|
||||
## > Num.neg 0.0
|
||||
##
|
||||
## This will crash when given #Int.lowestValue, because doing so will result in a number higher than #Int.highestValue.
|
||||
##
|
||||
## (It will never crash when given a #Float, however, because of how floating point numbers represent positive and negative numbers.)
|
||||
negate : Num range -> Num range
|
||||
neg : Num range -> Num range
|
||||
|
||||
## Return the absolute value of the number.
|
||||
##
|
||||
|
Loading…
Reference in New Issue
Block a user