using System; using System.Collections.Generic; using System.Text; using DNAModule.Sunweaver.Commands.Attributes; namespace DNAModule.Sunweaver.Commands.UnaryMath { /// /// A little different from the standard square root. This returns the /// signed square root. For instance, -25 sqrt would return -5 /// [BasePair] public class sqrt : Abstracts.UnaryOperation { public override void Operation(long a) { VM.Stack.Push((long)Math.Sign(a) * (long)Math.Round(Math.Sqrt((double)Math.Abs(a)))); } } }