A simple class that prevents numbers from getting either too big or too small.
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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)));
 }