Commit f4a09e36 authored by Bergmann89's avatar Bergmann89

* [ugluVectorEx] implemented 'abs' function

parent 964accb4
......@@ -17,6 +17,7 @@
function ToString(const aRound: Integer = -3): String; inline;
class function FromString(const s: String): __VEC; static; inline;
class function TryFromString(const s: String; out v: __VEC): Boolean; static; inline;
class function Zero: __VEC; static; inline;
......@@ -424,6 +425,7 @@
type __HELPER_I = type helper(__HELPER) for __VEC
function Length: Double; inline;
function Abs: __VEC;
{$IF __SIZE <> 4}
function Add(const v: __VEC): __VEC; inline;
function Subtract(const v: __VEC): __VEC; inline;
......@@ -915,6 +917,13 @@
result := __IMPL.Length(self);
function __HELPER_I.Abs: __VEC;
var i: Integer;
for i := Low(self) to High(self) do
result[i] := System.abs(self[i]);
{$IF __SIZE <> 4}
function __HELPER_I.Add(const v: __VEC): __VEC;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment