Make assert_biteq! not rely on having Int in scope
This commit is contained in:
parent
f88b7c8a46
commit
579627ddd5
9 changed files with 9 additions and 9 deletions
|
|
@ -26,7 +26,7 @@ pub fn fmax<F: Float>(x: F, y: F) -> F {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int};
|
||||
use crate::support::Hexf;
|
||||
|
||||
fn spec_test<F: Float>() {
|
||||
let cases = [
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ pub fn fmaximum<F: Float>(x: F, y: F) -> F {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int};
|
||||
use crate::support::Hexf;
|
||||
|
||||
fn spec_test<F: Float>() {
|
||||
let cases = [
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub fn fmaximum_num<F: Float>(x: F, y: F) -> F {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int};
|
||||
use crate::support::Hexf;
|
||||
|
||||
fn spec_test<F: Float>() {
|
||||
let cases = [
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub fn fmin<F: Float>(x: F, y: F) -> F {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int};
|
||||
use crate::support::Hexf;
|
||||
|
||||
fn spec_test<F: Float>() {
|
||||
let cases = [
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ pub fn fminimum<F: Float>(x: F, y: F) -> F {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int};
|
||||
use crate::support::Hexf;
|
||||
|
||||
fn spec_test<F: Float>() {
|
||||
let cases = [
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub fn fminimum_num<F: Float>(x: F, y: F) -> F {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int};
|
||||
use crate::support::Hexf;
|
||||
|
||||
fn spec_test<F: Float>() {
|
||||
let cases = [
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ pub fn rint_round<F: Float>(x: F, _round: Round) -> FpResult<F> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::support::{Hexf, Int, Status};
|
||||
use crate::support::{Hexf, Status};
|
||||
|
||||
fn spec_test<F: Float>(cases: &[(F, F, Status)]) {
|
||||
let roundtrip = [F::ZERO, F::ONE, F::NEG_ONE, F::NEG_ZERO, F::INFINITY, F::NEG_INFINITY];
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ where
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::super::super::Int;
|
||||
use super::*;
|
||||
|
||||
// Tests against N3220
|
||||
|
|
|
|||
|
|
@ -137,9 +137,10 @@ macro_rules! hf128 {
|
|||
#[cfg(test)]
|
||||
macro_rules! assert_biteq {
|
||||
($left:expr, $right:expr, $($tt:tt)*) => {{
|
||||
use $crate::support::Int;
|
||||
let l = $left;
|
||||
let r = $right;
|
||||
let bits = (l.to_bits() - l.to_bits()).leading_zeros(); // hack to get the width from the value
|
||||
let bits = Int::leading_zeros(l.to_bits() - l.to_bits()); // hack to get the width from the value
|
||||
assert!(
|
||||
l.biteq(r),
|
||||
"{}\nl: {l:?} ({lb:#0width$x})\nr: {r:?} ({rb:#0width$x})",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue