From fa78fee4de8eab389f20279dbafaae461b18e3e7 Mon Sep 17 00:00:00 2001 From: Jesse Ruderman Date: Sun, 10 Jul 2011 16:09:48 -0700 Subject: [PATCH] Add uint::min --- src/lib/uint.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/uint.rs b/src/lib/uint.rs index 6908aa6342a..2b3c2875c93 100644 --- a/src/lib/uint.rs +++ b/src/lib/uint.rs @@ -24,6 +24,8 @@ pred gt(uint x, uint y) -> bool { ret x > y; } fn max(uint x, uint y) -> uint { if (x > y) { ret x; } ret y; } +fn min(uint x, uint y) -> uint { if (x > y) { ret y; } ret x; } + iter range(uint lo, uint hi) -> uint { auto lo_ = lo; while (lo_ < hi) { put lo_; lo_ += 1u; }