Groophy.Math.Math.Root(new GValue("2"), new GValue("9"));
-> 2√9 -> X^2 = 9 -> X = 3
In the Square_Root function n is always 2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /// <summary> /// https://groophy-inc.github.io/root /// </summary> /// <param name="n"></param> /// <param name="val"></param> /// <returns></returns> public static GValue Root(GValue n, GValue val) { return new GValue((System.Math.Pow(val.get_Double,Math.Division(new GValue("1"), n).get_Double)).ToString()); } /// <summary> /// https://groophy-inc.github.io/root /// </summary> /// <param name="val"></param> /// <returns></returns> public static GValue Square_Root(GValue val) { return new GValue((System.Math.Pow(val.get_Double, Math.Division(new GValue("1"), new GValue("2")).get_Double)).ToString()); } |
Copyright © Groophy.Inc ' Batch-Man