public string Set(DNumber index, DChar with) { var chars = value.ToCharArray(); chars[index.ToInt()] = with.value; return(new string(chars)); }
public double NthRoot(DNumber value, DNumber root) { if (root.ToFloat() % 2 == 0 || value.ToFloat() >= 0) { // if even return(Math.Pow(value.ToFloat(), 1.0f / root.ToFloat())); } else { // if odd return(-Math.Pow(-value.ToFloat(), 1.0f / root.ToFloat())); } }
public double Atan(DNumber n) { return(Math.Atan(n.ToFloat())); }
public double Acos(DNumber n) { return(Math.Acos(n.ToFloat())); }
public DObject Set(DNumber index, DObject value) { return(items[index.ToInt()].Value = value); }
public double Min(DNumber n1, DNumber n2) { return(Math.Min(n1.ToFloat(), n2.ToFloat())); }
public double Floor(DNumber n) { return(Math.Floor(n.ToFloat())); }
public double Cosh(DNumber n) { return(Math.Cosh(n.ToFloat())); }
public double Round(DNumber n) { return(Math.Round(n.ToFloat())); }
public string Insert(DNumber index, DString with) => value.Insert(index.ToInt(), value.ToString());
public string Substring(DNumber index) => value.Substring(index.ToInt());
public string Remove(DNumber index) => value.Remove(index.ToInt());
public void Remove(DNumber index) => items.RemoveAt(index.ToInt());
public double Atan2(DNumber n1, DNumber n2) { return(Math.Atan2(n1.ToFloat(), n2.ToFloat())); }
public int Sign(DNumber n) { return(Math.Sign(n.ToFloat())); }
public double Ceiling(DNumber n) { return(Math.Ceiling(n.ToFloat())); }
public double Sinh(DNumber n) { return(Math.Sinh(n.ToFloat())); }
public double Exp(DNumber n) { return(Math.Exp(n.ToFloat())); }
public double Sqrt(DNumber n) { return(Math.Sqrt(n.ToFloat())); }
public double Log(DNumber n) { return(Math.Log10(n.ToFloat())); }
public double Tanh(DNumber n) { return(Math.Tanh(n.ToFloat())); }
public double Limit(DNumber value, DNumber lower, DNumber upper) { return(Math.Min(upper.ToFloat(), Math.Max(lower.ToFloat(), value.ToFloat()))); }
public DObject Get(DNumber index) { return(items[index.ToInt()].Value); }