Bound() public static method

Bound the number so that it does not become too big or too small.
public static Bound ( double d ) : double
d double The number to check.
return double
Beispiel #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)));
 }
Beispiel #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)));
 }
Beispiel #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)));
 }
Beispiel #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)));
 }
Beispiel #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)));
 }