Example #1
0
 public bool VisitRational(RationalDatum d)
 {
     bw.Write(B_RATIONAL);
     bw.WriteBigInteger(d.Value.Numerator);
     bw.WriteBigInteger(d.Value.Denominator);
     return(true);
 }
Example #2
0
 private int CompareRational(RationalDatum x, RationalDatum y)
 {
     if (x.Value < y.Value)
     {
         return(-1);
     }
     if (x.Value > y.Value)
     {
         return(1);
     }
     return(0);
 }
 public string VisitRational(RationalDatum d)
 {
     return(d.Value.ToString());
 }
 public State VisitRational(State state, RationalDatum d) => state;
 public SetDatum VisitRational(RationalDatum d) => SetDatum.Empty;
Example #6
0
 public string VisitRational(RationalDatum d)
 {
     return($"r{d.Value.Numerator}/{d.Value.Denominator}");
 }
 private bool EqualRational(RationalDatum x, RationalDatum y)
 {
     return(x.Value == y.Value);
 }