Document future intentions regarding the cast
function.
This commit is contained in:
parent
54953a8f01
commit
f9778adf17
2 changed files with 10 additions and 6 deletions
|
@ -7,8 +7,8 @@ Lmath is generic linear algebra library for Rust. There is still much to do, uni
|
||||||
- ~~Matrix inversion~~
|
- ~~Matrix inversion~~
|
||||||
- ~~Matrix rotation~~
|
- ~~Matrix rotation~~
|
||||||
- ~~Angle types (degrees/radians)~~
|
- ~~Angle types (degrees/radians)~~
|
||||||
- N x M matrices
|
|
||||||
- Operator Overloading
|
- Operator Overloading
|
||||||
|
- Phase out the use of `num::cast::cast` for numeric conversions
|
||||||
- Implement component-wise functions for vectors
|
- Implement component-wise functions for vectors
|
||||||
- Euler and axial rotations
|
- Euler and axial rotations
|
||||||
- Performance improvements
|
- Performance improvements
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
/**
|
/**
|
||||||
* This trait allows for the easy casting between each of thethe built in
|
* Wrapper methods for numeric type casts
|
||||||
* numeric types, going above and beyond the static 'to_int' function found in
|
*
|
||||||
* the Num trait. I've found that it is especially handy in generic functions
|
* Note: although the `from` and `cast` medods are still inclueded, they will
|
||||||
* when you need to mix floating point and integer values.
|
* be phased out in favour of the `num::kinds::Number::from<T:Number(n: T)`
|
||||||
|
* static constructor method. I feel that this will be far clearer than using
|
||||||
|
* the `cast` function everywhere.
|
||||||
*/
|
*/
|
||||||
pub trait NumCast {
|
pub trait NumCast {
|
||||||
|
// TODO: the plan is to remove the `from` and `cast` methods and use the
|
||||||
|
// `num::kinds::Number::from<T:Number(n: T)` method instead
|
||||||
static pure fn from<T:NumCast>(n: T) -> self;
|
static pure fn from<T:NumCast>(n: T) -> self;
|
||||||
pure fn cast<T:NumCast>(&self) -> T;
|
pure fn cast<T:NumCast>(&self) -> T;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue