Esempio n. 1
0
        public override object Do(KObject args, KEnvironment env, Continuation <KObject> cont)
        {
            CPara(args, 1);
            var inex = First(args) as KDouble;

            Check(inex);
            return(KFraction.fromDouble(inex.Value));
        }
Esempio n. 2
0
 public static KFraction ToExact(KObject obj)
 {
     if (obj is KFraction)
     {
         return(obj as KFraction);
     }
     else
     {
         return(KFraction.fromDouble((obj as KDouble).Value));
     }
 }