[types] Document fields of Frac

This commit is contained in:
Eryn Wells 2018-09-09 11:24:10 -07:00
parent 1b26497d19
commit e7273d6c98

View file

@ -9,9 +9,14 @@ use number::arith::GCD;
use number::{Int, Number};
use object::{Obj, Object};
/// A fraction consisting of a numerator and denominator.
/// A fraction of two integers.
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct Frac { p: Int, q: Int }
pub struct Frac {
/// The numerator.
p: Int,
/// The denominator.
q: Int
}
impl Frac {
pub fn new(p: Int, q: Int) -> Result<Frac, ()> {