Absolute

Groophy.Math.Math.Abs(new GValue("-734"));
-> 734

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
        /// <summary>
        /// https://groophy-inc.github.io/abs
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static GValue Abs(GValue value)
        {
            if (value.get_Long < 0)
            {
                return Math.Multiplication(value, new GValue("-1"));
            }
            return value;
        }

        /// <summary>
        /// https://groophy-inc.github.io/abs
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static GValue Absolute(GValue value)
        {
            if (value.get_Long < 0)
            {
                return Math.Multiplication(value, new GValue("-1"));
            }
            return value;
        }

Contact Us

Copyright © Groophy.Inc ' Batch-Man