Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit ae7d82cd authored by Harald MARTINI's avatar Harald MARTINI
Browse files

added converted si Abs() method

parent c49b2382
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@
*/
using System;
using System.Diagnostics;
using System.Globalization;
namespace TUGraz.VectoCommon.Utils
......@@ -75,6 +76,12 @@ namespace TUGraz.VectoCommon.Utils
}
}
[DebuggerHidden]
public ConvertedSI Abs()
{
return new ConvertedSI(Math.Abs(Value), Units);
}
public static implicit operator double(ConvertedSI self)
{
return self._value;
......@@ -337,6 +344,8 @@ namespace TUGraz.VectoCommon.Utils
return new ConvertedSI(m3pm3m.Value() * CubicMeterToLiter * Kilo, "l/m³-km");
}
public static Meter ConvertToMeter(this ConvertedSI mm)
{
if (mm.Units != "mm") {
......
......@@ -161,6 +161,12 @@ namespace TUGraz.VectoCommon.Utils
{
return si.Abs();
}
[DebuggerStepThrough]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ConvertedSI Abs(ConvertedSI cSi)
{
return cSi.Abs();
}
/// <summary>
/// Returns the minimum of two values.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment