Remake the number module directory
This commit is contained in:
parent
8fe0bf3f71
commit
6ae557d837
1 changed files with 0 additions and 0 deletions
24
types/src/number/mod.rs
Normal file
24
types/src/number/mod.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* number.rs
|
||||
* Eryn Wells <eryn@erynwells.me>
|
||||
*/
|
||||
|
||||
/// # Numbers
|
||||
///
|
||||
/// Scheme numbers are complex, literally.
|
||||
|
||||
type Int = i64;
|
||||
type Flt = f64;
|
||||
|
||||
trait Number {
|
||||
fn is_number(&self) -> bool { true }
|
||||
fn is_complex(&self) -> bool { false }
|
||||
fn is_real(&self) -> bool { false }
|
||||
fn is_rational(&self) -> bool { false }
|
||||
fn is_integer(&self) -> bool { false }
|
||||
}
|
||||
|
||||
struct Integer(Int);
|
||||
struct Rational(Int, Int);
|
||||
struct Real(Flt);
|
||||
struct Complex<'a>(&'a Number, &'a Number);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue