math: Add 'almost_Equals' function.

This commit is contained in:
Rod Kay
2024-01-16 14:11:19 +11:00
parent ededc9ece8
commit 5d39177e87
2 changed files with 31 additions and 6 deletions

View File

@@ -49,15 +49,18 @@ is
subtype Real is Real_t;
subtype unit_Interval is Real range 0.0 .. 1.0;
function almost_Zero (Self : in Real) return Boolean;
function almost_Zero (Self : in Real) return Boolean;
function almost_Equals (Self,
Other,
Tolerance : in Real := Real'Base'Model_Small) return Boolean;
function Clamped (Self : in Real; Low, High : in Real) return Real;
procedure clamp (Self : in out Real; Low, High : in Real);
function Clamped (Self : in Real; Low, High : in Real) return Real;
procedure clamp (Self : in out Real; Low, High : in Real);
procedure swap (Left,
Right : in out Real);
procedure swap (Left,
Right : in out Real);
function Image (Self : in Real; Precision : in Natural := 5) return String;
function Image (Self : in Real; Precision : in Natural := 5) return String;
-------------
@@ -170,6 +173,8 @@ is
overriding
function "abs" (Right : in Vector_3) return Vector_3;
function almost_Equals (Self, Other : in Vector_3;
Tolerance : in Real := Real'Base'Model_Small) return Boolean;
-----------
-- Matrices