Operations and constants for i16
bits
bytes
max_value
min_value
of num::Num for T
of num::Zero for T
of num::One for T
of iter::Times for T
of FromStr for T
abs
- Computes the absolute valueadd
compl
- Computes the bitwise complementdiv
eq
from_str
- Parse a string to an intge
gt
is_negative
is_nonnegative
is_nonpositive
is_positive
le
lt
max
min
mul
ne
parse_bytes
- Parse a buffer of bytesrange
- Iterate over the range [lo
..hi
)rem
str
- Convert to a stringsub
to_str
- Convert to a string in a given baseto_str_bytes
i16::inst
bits
uint
bytes
uint
max_value
T
min_value
T
num::Num
for T
add
fn add(other: &T) -> T
sub
fn sub(other: &T) -> T
mul
fn mul(other: &T) -> T
div
fn div(other: &T) -> T
modulo
fn modulo(other: &T) -> T
neg
fn neg() -> T
to_int
fn to_int() -> int
from_int
fn from_int(n: int) -> T
num::Zero
for T
zero
fn zero() -> T
num::One
for T
one
fn one() -> T
iter::Times
for T
times
fn times(it: &fn() -> bool)
A convenience form for basic iteration. Given a variable x
of any numeric type, the expression for x.times { /* anything */ }
will execute the given function exactly x times. If we assume that x
is an int, this is functionally equivalent to for int::range(0, x) |_i| { /* anything */ }
.
FromStr
for T
from_str
fn from_str(s: &str) -> Option<T>
abs
fn abs(i: T) -> T
Computes the absolute value
add
fn add(x: T, y: T) -> T
compl
fn compl(i: T) -> T
Computes the bitwise complement
div
fn div(x: T, y: T) -> T
eq
fn eq(x: T, y: T) -> bool
from_str
fn from_str(s: &str) -> Option<T>
Parse a string to an int
ge
fn ge(x: T, y: T) -> bool
gt
fn gt(x: T, y: T) -> bool
is_negative
fn is_negative(x: T) -> bool
is_nonnegative
fn is_nonnegative(x: T) -> bool
is_nonpositive
fn is_nonpositive(x: T) -> bool
is_positive
fn is_positive(x: T) -> bool
le
fn le(x: T, y: T) -> bool
lt
fn lt(x: T, y: T) -> bool
max
fn max(x: T, y: T) -> T
min
fn min(x: T, y: T) -> T
mul
fn mul(x: T, y: T) -> T
ne
fn ne(x: T, y: T) -> bool
parse_bytes
fn parse_bytes(buf: &[u8], radix: uint) -> Option<T>
Parse a buffer of bytes
range
fn range(lo: T, hi: T, it: &fn(T) -> bool)
Iterate over the range [lo
..hi
)
rem
fn rem(x: T, y: T) -> T
str
fn str(i: T) -> ~str
Convert to a string
sub
fn sub(x: T, y: T) -> T
to_str
fn to_str(n: T, radix: uint) -> ~str
Convert to a string in a given base
to_str_bytes
fn to_str_bytes<U>(n: T, radix: uint, f: &fn(v: &[u8]) -> U) -> U