2012-01-05 10:11:34 -06:00
|
|
|
// Generic functions that have been defined for all numeric types
|
|
|
|
//
|
|
|
|
// (may very well go away again soon)
|
|
|
|
|
|
|
|
/*
|
|
|
|
Function: min
|
|
|
|
|
|
|
|
Returns the minimum of two values
|
|
|
|
*/
|
2012-01-05 10:18:40 -06:00
|
|
|
pure fn min<T: copy>(x: T, y: T) -> T { x < y ? x : y }
|
2012-01-05 10:11:34 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
Function: max
|
|
|
|
|
|
|
|
Returns the maximum of two values
|
|
|
|
*/
|
2012-01-05 10:18:40 -06:00
|
|
|
pure fn max<T: copy>(x: T, y: T) -> T { x < y ? y : x }
|
2012-01-05 10:11:34 -06:00
|
|
|
|