From cd1cb39d43dc9af56d6a5cb0fab3f0548149883d Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 6 May 2018 15:03:12 +0000 Subject: [PATCH] add forgotten file: math.h add .in function git-svn-id: svn://kolibrios.org@7272 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/math.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/programs/cmm/lib/math.h b/programs/cmm/lib/math.h index 09f50917e9..1f0ccb94c9 100644 --- a/programs/cmm/lib/math.h +++ b/programs/cmm/lib/math.h @@ -20,6 +20,7 @@ signed ceil(float x); signed min(signed i1, i2); signed max(signed i1, i2); + signed in(signed base, min1, max1); }math; :signed MATH::round(float x) @@ -109,4 +110,10 @@ else return i2; } +:signed MATH::in(signed base, min1, max1) +{ + if (base > max1) return max1; + if (base < min1) return min1; + return base; +} #endif \ No newline at end of file