Example #1
0
 protected bool Equals(Greeks other)
 {
     return(Gamma.AlmostEqual(other.Gamma, 4) &&
            Delta.AlmostEqual(other.Delta, 4) &&
            Theta.AlmostEqual(other.Theta, 4) &&
            Vega.AlmostEqual(other.Vega, 4) &&
            Rho.AlmostEqual(other.Rho, 4) &&
            RhoFx.AlmostEqual(other.RhoFx, 4) &&
            Sigma.AlmostEqual(other.Sigma, 4));
 }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Gamma.GetHashCode();
         hashCode = (hashCode * 397) ^ Delta.GetHashCode();
         hashCode = (hashCode * 397) ^ Theta.GetHashCode();
         hashCode = (hashCode * 397) ^ Vega.GetHashCode();
         hashCode = (hashCode * 397) ^ Rho.GetHashCode();
         hashCode = (hashCode * 397) ^ RhoFx.GetHashCode();
         hashCode = (hashCode * 397) ^ Sigma.GetHashCode();
         return(hashCode);
     }
 }