A simple class that prevents numbers from getting either too big or too small.
Example #1
0
 /// <summary>
 /// Calculate the sin.
 /// </summary>
 /// <param name="a">The value passed to the function.</param>
 /// <returns>The result of the function.</returns>
 public static double Sin(double a)
 {
     return(BoundNumbers.Bound(Math.Sin(a)));
 }
Example #2
0
 /// <summary>
 /// Calculate the power of a number.
 /// </summary>
 /// <param name="a">The base.</param>
 /// <param name="b">The exponent.</param>
 /// <returns></returns>
 public static double Pow(double a, double b)
 {
     return(BoundNumbers.Bound(Math.Pow(a, b)));
 }
Example #3
0
 /// <summary>
 /// Calculate the exp.
 /// </summary>
 /// <param name="a">The value passed to the function.</param>
 /// <returns>The result of the function.</returns>
 public static double Exp(double a)
 {
     return(BoundNumbers.Bound(Math.Exp(a)));
 }
Example #4
0
 /// <summary>
 /// Calculate the log.
 /// </summary>
 /// <param name="a">The value passed to the function.</param>
 /// <returns>The result of the function.</returns>
 public static double Log(double a)
 {
     return(BoundNumbers.Bound(Math.Log(a)));
 }
Example #5
0
 /// <summary>
 /// Calculate the cos.
 /// </summary>
 /// <param name="a">The value passed to the function.</param>
 /// <returns>The result of the function.</returns>
 public static double Cos(double a)
 {
     return(BoundNumbers.Bound(Math.Cos(a)));
 }