Fixed the num crate

This commit is contained in:
Dzmitry Malyshau 2015-04-24 23:28:31 -04:00
parent 3bd90171e9
commit 16302ffa20
8 changed files with 9 additions and 14 deletions

View file

@ -1,7 +1,7 @@
[package] [package]
name = "cgmath" name = "cgmath"
version = "0.1.4" version = "0.1.5"
authors = ["Brendan Zabarauskas <bjzaba@yahoo.com.au>", authors = ["Brendan Zabarauskas <bjzaba@yahoo.com.au>",
"Brian Heylin", "Brian Heylin",
"Colin Sherratt", "Colin Sherratt",

View file

@ -17,13 +17,13 @@
use std::fmt; use std::fmt;
use std::f64; use std::f64;
use std::num::cast;
use std::ops::*; use std::ops::*;
use rand::{Rand, Rng}; use rand::{Rand, Rng};
use rand::distributions::range::SampleRange; use rand::distributions::range::SampleRange;
use rust_num::{Float, One, Zero, one, zero}; use rust_num::{Float, One, Zero, one, zero};
use rust_num::traits::cast;
use approx::ApproxEq; use approx::ApproxEq;
use num::BaseFloat; use num::BaseFloat;

View file

@ -13,8 +13,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::num::{NumCast, cast}; use rust_num::{Float, NumCast};
use rust_num::Float; use rust_num::traits::cast;
pub trait ApproxEq<T: NumCast + Float>: Sized { pub trait ApproxEq<T: NumCast + Float>: Sized {
fn approx_epsilon(_hack: Option<Self>) -> T { fn approx_epsilon(_hack: Option<Self>) -> T {

View file

@ -17,12 +17,12 @@
use std::fmt; use std::fmt;
use std::mem; use std::mem;
use std::num::cast;
use std::ops::*; use std::ops::*;
use rand::{Rand, Rng}; use rand::{Rand, Rng};
use rust_num::{Zero, zero, One, one}; use rust_num::{Zero, zero, One, one};
use rust_num::traits::cast;
use angle::{Rad, sin, cos, sin_cos}; use angle::{Rad, sin, cos, sin_cos};
use approx::ApproxEq; use approx::ApproxEq;

View file

@ -17,9 +17,8 @@ use approx::ApproxEq;
use std::cmp; use std::cmp;
use std::fmt; use std::fmt;
use std::num::NumCast;
use rust_num::{Float, Num}; use rust_num::{Float, Num, NumCast};
/// A trait providing a [partial ordering](http://mathworld.wolfram.com/PartialOrder.html). /// A trait providing a [partial ordering](http://mathworld.wolfram.com/PartialOrder.html).
pub trait PartialOrd { pub trait PartialOrd {

View file

@ -13,9 +13,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::num::cast;
use rust_num::{zero, one}; use rust_num::{zero, one};
use rust_num::traits::cast;
use angle::{Angle, tan, cot}; use angle::{Angle, tan, cot};
use frustum::Frustum; use frustum::Frustum;

View file

@ -16,11 +16,11 @@
use std::f64; use std::f64;
use std::fmt; use std::fmt;
use std::mem; use std::mem;
use std::num::cast;
use std::ops::*; use std::ops::*;
use rand::{Rand, Rng}; use rand::{Rand, Rng};
use rust_num::{Float, one, zero}; use rust_num::{Float, one, zero};
use rust_num::traits::cast;
use angle::{Angle, Rad, acos, sin, sin_cos, rad}; use angle::{Angle, Rad, acos, sin, sin_cos, rad};
use approx::ApproxEq; use approx::ApproxEq;
@ -242,8 +242,6 @@ impl<S: BaseFloat> Quaternion<S> {
/// - [Arcsynthesis OpenGL tutorial] /// - [Arcsynthesis OpenGL tutorial]
/// (http://www.arcsynthesis.org/gltut/Positioning/Tut08%20Interpolation.html) /// (http://www.arcsynthesis.org/gltut/Positioning/Tut08%20Interpolation.html)
pub fn slerp(&self, other: &Quaternion<S>, amount: S) -> Quaternion<S> { pub fn slerp(&self, other: &Quaternion<S>, amount: S) -> Quaternion<S> {
use std::num::cast;
let dot = self.dot(other); let dot = self.dot(other);
let dot_threshold = cast(0.9995f64).unwrap(); let dot_threshold = cast(0.9995f64).unwrap();

View file

@ -98,12 +98,11 @@
use std::fmt; use std::fmt;
use std::mem; use std::mem;
use std::num::NumCast;
use std::ops::*; use std::ops::*;
use rand::{Rand, Rng}; use rand::{Rand, Rng};
use rust_num::{Zero, One, zero, one}; use rust_num::{NumCast, Zero, One, zero, one};
use angle::{Rad, atan2, acos}; use angle::{Rad, atan2, acos};
use approx::ApproxEq; use approx::ApproxEq;