From ac70088e6b5ea15eeb9dc3d986fcddf4bd17ee43 Mon Sep 17 00:00:00 2001 From: hachibu Date: Thu, 26 Feb 2015 11:34:08 -0500 Subject: [PATCH] doc: add documentation for ceil, floor, .., and ... in num.markdown --- doc/site/core/num.markdown | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/doc/site/core/num.markdown b/doc/site/core/num.markdown index ef19ee09..b874a629 100644 --- a/doc/site/core/num.markdown +++ b/doc/site/core/num.markdown @@ -1,8 +1,6 @@ ^title Num Class ^category core -**TODO** - ### **abs** The absolute value of the number. @@ -12,7 +10,10 @@ The absolute value of the number. ### **ceil** -**TODO** +Rounds the number up to the nearest integer. + + :::dart + 1.5.ceil // 2 ### **cos** @@ -20,7 +21,10 @@ The cosine of the number. ### **floor** -**TODO** +Round the number down to the nearest integer. + + :::dart + 1.5.floor // 1 ### **isNan** @@ -85,15 +89,33 @@ It is a runtime error if `other` is not a number. ### **..**(other) operator -**TODO** +Creates a [Range](core/range.html) representing a consecutive range of integers +from the beginning number to the ending number. + + :::dart + for (i in 1..3) { + IO.print(i) + } + // 1 + // 2 + // 3 ### **...**(other) operator -**TODO** +Creates a [Range](core/range.html) representing a consecutive range of integers +from the beginning number to the ending number not including the ending number. + + :::dart + for (i in 1...3) { + IO.print(i) + } + // 1 + // 2 ### Num.**fromString**(value) Attempts to parse `value` as a decimal literal and return it as an instance of `Num`. If the number cannot be parsed `null` will be returned. -It is a runtime error if `value` is not a string. \ No newline at end of file +It is a runtime error if `value` is not a string. +