cli: bootstrap verified std bytes and math with source imports
This commit is contained in:
52 files changed
+1000
-22
No files matched your search
@@ -0,0 +1,22 @@
|
||||
module std.math
|
||||
|
||||
fn min_u64(a: u64, b: u64) -> u64
|
||||
effects []
|
||||
{
|
||||
if a < b { return a; }
|
||||
return b;
|
||||
}
|
||||
|
||||
fn max_u64(a: u64, b: u64) -> u64
|
||||
effects []
|
||||
{
|
||||
if a > b { return a; }
|
||||
return b;
|
||||
}
|
||||
|
||||
fn clamp_u64(value: u64, lower: u64, upper: u64) -> u64
|
||||
effects []
|
||||
{
|
||||
assert(lower <= upper);
|
||||
return std.math.min_u64(std.math.max_u64(value, lower), upper);
|
||||
}
|
||||
Reference in new issue
Block a user