This makes it possible to build `traits` without `std`. For this a new
trait `BasicFloat` was introduced, implementing some basic functionality
that works with `core`. Most notably this is lacking functions like
`cos`, `sin`, etc.
`Float` is not available without `std`.
Refs #216.
There are two new "utility" traits covering the basic operators:
`Add`, `Sub`, `Mul`, `Div`, and `Rem`.
- `NumOps<Rhs, Output>`: operators with an arbitrary operand and output.
- `NumAssignOps<Rhs>`: assignment operators with an arbitrary operand.
Then the new collection of numeric traits are:
- `Num`: effectively unchanged, just taking operands by value.
- `NumRef`: `Num` adding reference operands on the right side.
- `RefNum`: `&T` operators, with either `T` or `&T` on the right side.
- This does not specify `T: Num`, as rust-lang/rust#20671 means that
could only add a constraint, without implying its presence for use.
- `NumAssign`: `Num` adding assignment operators by value.
- `NumAssignRef`: `NumAssign` adding reference assignment operators.
- Nothing actually implements this yet!
Acknowledgement: this is roughly based on [@andersk's suggestion][1].
[1] https://github.com/rust-num/num/issues/94#issuecomment-269073071
Also update to use https instead of http. This avois mixed content
degradation on docs.rs.
The doc root URLs are correct as they are, the URL does not include the
crate name itself.
For some reason, rustc 1.0.0 can't find `PrimInt` if it's before `cast`,
but later versions are fine with this. That may have been a compiler
bug that was fixed. Switching the order seems to work everywhere.