Make assert_biteq! not rely on having Int in scope

This commit is contained in:
Trevor Gross 2025-04-18 00:22:38 +00:00 committed by Trevor Gross
parent f88b7c8a46
commit 579627ddd5
9 changed files with 9 additions and 9 deletions

View file

@ -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 = [

View file

@ -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 = [

View file

@ -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 = [

View file

@ -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 = [

View file

@ -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 = [

View file

@ -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 = [

View file

@ -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];

View file

@ -121,7 +121,6 @@ where
#[cfg(test)]
mod tests {
use super::super::super::Int;
use super::*;
// Tests against N3220

View file

@ -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})",