예제 #1
0
파일: NeoFloat.cs 프로젝트: sci4me/Neo-old
 public override int Compare(NeoValue other)
 {
     if (other.IsInt)
     {
         return(((double)other.CheckInt().Value).CompareTo(Value));
     }
     else if (other.IsFloat)
     {
         return(other.CheckFloat().Value.CompareTo(Value));
     }
     throw new NeoError($"Attempt to compare float to {other.Type}");
 }
예제 #2
0
파일: NeoFloat.cs 프로젝트: sci4me/Neo-old
 public override bool Equals(NeoValue other, bool deep)
 {
     if (other.IsInt)
     {
         return(((double)other.CheckInt().Value) == Value);
     }
     else if (other.IsFloat)
     {
         return(other.CheckFloat().Value == Value);
     }
     else
     {
         return(false);
     }
 }