Skip to content

Commit a9f9227

Browse files
mbrubeckbrson
authored andcommitted
Add std documentation for float and u8 functions
1 parent 9e4c2b6 commit a9f9227

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/lib/float.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,34 +223,49 @@ fn neg_infinity() -> float {
223223
ret -1./0.;
224224
}
225225

226+
/* Function: add */
226227
pure fn add(x: float, y: float) -> float { ret x + y; }
227228

229+
/* Function: sub */
228230
pure fn sub(x: float, y: float) -> float { ret x - y; }
229231

232+
/* Function: mul */
230233
pure fn mul(x: float, y: float) -> float { ret x * y; }
231234

235+
/* Function: div */
232236
pure fn div(x: float, y: float) -> float { ret x / y; }
233237

238+
/* Function: rem */
234239
pure fn rem(x: float, y: float) -> float { ret x % y; }
235240

241+
/* Predicate: lt */
236242
pure fn lt(x: float, y: float) -> bool { ret x < y; }
237243

244+
/* Predicate: le */
238245
pure fn le(x: float, y: float) -> bool { ret x <= y; }
239246

247+
/* Predicate: eq */
240248
pure fn eq(x: float, y: float) -> bool { ret x == y; }
241249

250+
/* Predicate: ne */
242251
pure fn ne(x: float, y: float) -> bool { ret x != y; }
243252

253+
/* Predicate: ge */
244254
pure fn ge(x: float, y: float) -> bool { ret x >= y; }
245255

256+
/* Predicate: gt */
246257
pure fn gt(x: float, y: float) -> bool { ret x > y; }
247258

259+
/* Predicate: positive */
248260
pure fn positive(x: float) -> bool { ret x > 0.; }
249261

262+
/* Predicate: negative */
250263
pure fn negative(x: float) -> bool { ret x < 0.; }
251264

265+
/* Predicate: nonpositive */
252266
pure fn nonpositive(x: float) -> bool { ret x <= 0.; }
253267

268+
/* Predicate: nonnegative */
254269
pure fn nonnegative(x: float) -> bool { ret x >= 0.; }
255270

256271
//

src/lib/u8.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,52 @@
1+
/*
2+
Module: u8
3+
*/
4+
5+
/*
6+
Function: max_value
7+
8+
The maximum value of a u8.
9+
*/
110
pure fn max_value() -> u8 { ret 255u8; }
11+
12+
/*
13+
Function: min_value
14+
15+
The minumum value of a u8.
16+
*/
217
pure fn min_value() -> u8 { ret 0u8; }
318

19+
/* Function: add */
420
pure fn add(x: u8, y: u8) -> u8 { ret x + y; }
521

22+
/* Function: sub */
623
pure fn sub(x: u8, y: u8) -> u8 { ret x - y; }
724

25+
/* Function: mul */
826
pure fn mul(x: u8, y: u8) -> u8 { ret x * y; }
927

28+
/* Function: div */
1029
pure fn div(x: u8, y: u8) -> u8 { ret x / y; }
1130

31+
/* Function: rem */
1232
pure fn rem(x: u8, y: u8) -> u8 { ret x % y; }
1333

34+
/* Predicate: lt */
1435
pure fn lt(x: u8, y: u8) -> bool { ret x < y; }
1536

37+
/* Predicate: le */
1638
pure fn le(x: u8, y: u8) -> bool { ret x <= y; }
1739

40+
/* Predicate: eq */
1841
pure fn eq(x: u8, y: u8) -> bool { ret x == y; }
1942

43+
/* Predicate: ne */
2044
pure fn ne(x: u8, y: u8) -> bool { ret x != y; }
2145

46+
/* Predicate: ge */
2247
pure fn ge(x: u8, y: u8) -> bool { ret x >= y; }
2348

49+
/* Predicate: gt */
2450
pure fn gt(x: u8, y: u8) -> bool { ret x > y; }
2551

2652
fn range(lo: u8, hi: u8, it: block(u8)) {

0 commit comments

Comments
 (0)