Skip to content

Commit

Permalink
Merge pull request #4 from 0ncorhynchus/master
Browse files Browse the repository at this point in the history
Replace Float with FloatCore

This fixes an issue where `matrixcompare` would not compile when used in `no-std` environments.
  • Loading branch information
Andlon authored Jan 13, 2021
2 parents 0e8e454 + 050ac0c commit ad7acf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/comparators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::ulp::{Ulp, UlpComparisonResult};

use num_traits::{Float, Num};
use num_traits::{float::FloatCore, Num};

use std::fmt;
use std::fmt::{Display, Formatter};
Expand Down Expand Up @@ -163,7 +163,7 @@ pub struct FloatElementwiseComparator<T> {

impl<T> FloatElementwiseComparator<T>
where
T: Float + Ulp,
T: FloatCore + Ulp,
{
pub fn default() -> Self {
let four = T::one() + T::one() + T::one() + T::one();
Expand Down Expand Up @@ -192,7 +192,7 @@ where

impl<T> ElementwiseComparator<T> for FloatElementwiseComparator<T>
where
T: Ulp + Float + Display,
T: Ulp + FloatCore + Display,
{
type Error = UlpError;

Expand Down

0 comments on commit ad7acf8

Please sign in to comment.