]> git.lizzy.rs Git - rust.git/commitdiff
Add std documentation for float and u8 functions
authorMatt Brubeck <mbrubeck@limpet.net>
Thu, 27 Oct 2011 19:46:55 +0000 (12:46 -0700)
committerBrian Anderson <banderson@mozilla.com>
Thu, 27 Oct 2011 20:37:53 +0000 (13:37 -0700)
src/lib/float.rs
src/lib/u8.rs

index 726ba8307b94f8061461dece7b2c730bd6675568..5bdf250069e94eae29793903e0e04c92ce976c8f 100644 (file)
@@ -223,34 +223,49 @@ fn neg_infinity() -> float {
    ret -1./0.;
 }
 
+/* Function: add */
 pure fn add(x: float, y: float) -> float { ret x + y; }
 
+/* Function: sub */
 pure fn sub(x: float, y: float) -> float { ret x - y; }
 
+/* Function: mul */
 pure fn mul(x: float, y: float) -> float { ret x * y; }
 
+/* Function: div */
 pure fn div(x: float, y: float) -> float { ret x / y; }
 
+/* Function: rem */
 pure fn rem(x: float, y: float) -> float { ret x % y; }
 
+/* Predicate: lt */
 pure fn lt(x: float, y: float) -> bool { ret x < y; }
 
+/* Predicate: le */
 pure fn le(x: float, y: float) -> bool { ret x <= y; }
 
+/* Predicate: eq */
 pure fn eq(x: float, y: float) -> bool { ret x == y; }
 
+/* Predicate: ne */
 pure fn ne(x: float, y: float) -> bool { ret x != y; }
 
+/* Predicate: ge */
 pure fn ge(x: float, y: float) -> bool { ret x >= y; }
 
+/* Predicate: gt */
 pure fn gt(x: float, y: float) -> bool { ret x > y; }
 
+/* Predicate: positive */
 pure fn positive(x: float) -> bool { ret x > 0.; }
 
+/* Predicate: negative */
 pure fn negative(x: float) -> bool { ret x < 0.; }
 
+/* Predicate: nonpositive */
 pure fn nonpositive(x: float) -> bool { ret x <= 0.; }
 
+/* Predicate: nonnegative */
 pure fn nonnegative(x: float) -> bool { ret x >= 0.; }
 
 //
index b7995a7d97905a10b09e2089a23330f86516a0e9..5f594165e19680303d656ab4ed2b8d2119bebc8a 100644 (file)
@@ -1,26 +1,52 @@
+/*
+Module: u8
+*/
+
+/*
+Function: max_value
+
+The maximum value of a u8.
+*/
 pure fn max_value() -> u8 { ret 255u8; }
+
+/*
+Function: min_value
+
+The minumum value of a u8.
+*/
 pure fn min_value() -> u8 { ret 0u8; }
 
+/* Function: add */
 pure fn add(x: u8, y: u8) -> u8 { ret x + y; }
 
+/* Function: sub */
 pure fn sub(x: u8, y: u8) -> u8 { ret x - y; }
 
+/* Function: mul */
 pure fn mul(x: u8, y: u8) -> u8 { ret x * y; }
 
+/* Function: div */
 pure fn div(x: u8, y: u8) -> u8 { ret x / y; }
 
+/* Function: rem */
 pure fn rem(x: u8, y: u8) -> u8 { ret x % y; }
 
+/* Predicate: lt */
 pure fn lt(x: u8, y: u8) -> bool { ret x < y; }
 
+/* Predicate: le */
 pure fn le(x: u8, y: u8) -> bool { ret x <= y; }
 
+/* Predicate: eq */
 pure fn eq(x: u8, y: u8) -> bool { ret x == y; }
 
+/* Predicate: ne */
 pure fn ne(x: u8, y: u8) -> bool { ret x != y; }
 
+/* Predicate: ge */
 pure fn ge(x: u8, y: u8) -> bool { ret x >= y; }
 
+/* Predicate: gt */
 pure fn gt(x: u8, y: u8) -> bool { ret x > y; }
 
 fn range(lo: u8, hi: u8, it: block(u8)) {