2012-07-04 21:53:12 +00:00
|
|
|
/// An interface for numbers.
|
2012-06-08 00:25:54 +00:00
|
|
|
|
|
|
|
iface num {
|
2012-06-15 01:18:43 +00:00
|
|
|
// FIXME: Cross-crate overloading doesn't work yet. (#2615)
|
|
|
|
// FIXME: Interface inheritance. (#2616)
|
2012-06-08 00:25:54 +00:00
|
|
|
fn add(&&other: self) -> self;
|
|
|
|
fn sub(&&other: self) -> self;
|
|
|
|
fn mul(&&other: self) -> self;
|
|
|
|
fn div(&&other: self) -> self;
|
|
|
|
fn modulo(&&other: self) -> self;
|
2012-06-08 01:27:10 +00:00
|
|
|
fn neg() -> self;
|
2012-06-08 00:25:54 +00:00
|
|
|
|
|
|
|
fn to_int() -> int;
|
|
|
|
fn from_int(n: int) -> self; // TODO: Static functions.
|
|
|
|
}
|
|
|
|
|