#[allow(unused_macros)]
macro_rules! show {
($e:expr) => { println!("{}: {:?}", stringify!($e), $e); }
}
#[allow(unused_macros)]
macro_rules! bits8 {
($e:expr) => { println!("{}: {:08b}", stringify!($e), $e); }
}
#[allow(unused_macros)]
macro_rules! bits64 {
($e:expr) => { println!("{}: {:064b}", stringify!($e), $e); }
}
use fixed::{FixedI8, FixedI16, FixedI32, FixedI64, FixedU8, FixedU16, FixedU32,
FixedU64, FixedI128, FixedU128};
use fixed::traits::Fixed;
use fixed::types::extra::*;
use integer_sqrt::IntegerSquareRoot;
use typenum::{UInt, UTerm};
use typenum::bit::{B0, B1};
pub mod traits;
use self::traits::*;
pub trait FixedSqrt : Fixed {
fn sqrt (self) -> Self;
}
macro_rules! impl_sqrt_unsigned_even {
($unsigned:ident, $lt:ident) => {
impl FixedSqrt for $unsigned <UTerm> {
fn sqrt (self) -> Self {
$unsigned::from_bits (
self.to_bits().integer_sqrt() <<
(<$unsigned <UTerm> as Fixed>::Frac::USIZE/2)
)
}
}
impl <U> FixedSqrt for $unsigned <UInt <U, B0>> where
UInt <U, B0> : $lt
{
fn sqrt (self) -> Self {
$unsigned::from_bits (
self.to_bits().integer_sqrt() <<
(<$unsigned <UInt <U, B0>> as Fixed>::Frac::USIZE/2)
)
}
}
}
}
macro_rules! impl_sqrt_unsigned_odd {
($unsigned:ident, $leq:ident, $higher:ty) => {
impl <U> FixedSqrt for $unsigned <UInt <U, B1>> where
UInt <U, B1> : $leq
{
fn sqrt (self) -> Self {
let bits = self.to_bits();
let sqrt = if
bits & (1 as <$unsigned <UInt <U, B1>> as Fixed>::Bits).rotate_right (1) > 0
{
let bits = bits as $higher << 1;
let sqrt = bits.integer_sqrt() << (<$unsigned <UInt <U, B1>>
as Fixed>::Frac::USIZE/2);
debug_assert!(sqrt <=
<$unsigned <UInt <U, B1>> as Fixed>::Bits::max_value() as $higher);
sqrt as <$unsigned <UInt <U, B1>> as Fixed>::Bits
} else {
let bits = bits << 1;
bits.integer_sqrt() << (<$unsigned <UInt <U, B1>> as Fixed>::Frac::USIZE/2)
};
$unsigned::from_bits (sqrt)
}
}
}
}
impl_sqrt_unsigned_even!(FixedU8, LeEqU8);
impl_sqrt_unsigned_even!(FixedU16, LeEqU16);
impl_sqrt_unsigned_even!(FixedU32, LeEqU32);
impl_sqrt_unsigned_even!(FixedU64, LeEqU64);
impl_sqrt_unsigned_even!(FixedU128, LeEqU128);
impl_sqrt_unsigned_odd!(FixedU8, LeEqU8, u16);
impl_sqrt_unsigned_odd!(FixedU16, LeEqU16, u32);
impl_sqrt_unsigned_odd!(FixedU32, LeEqU32, u64);
impl_sqrt_unsigned_odd!(FixedU64, LeEqU64, u128);
macro_rules! impl_sqrt_signed_even {
($signed:ident, $lt:ident, $unsigned:ty) => {
impl FixedSqrt for $signed <UTerm> {
fn sqrt (self) -> Self {
if self.is_negative() {
panic!("fixed point square root of a negative number");
}
let bits = self.to_bits() as $unsigned;
let sqrt = bits.integer_sqrt() <<
(<$signed <UTerm> as Fixed>::Frac::USIZE/2);
let n = $signed::from_bits (sqrt as <$signed <UTerm> as Fixed>::Bits);
debug_assert!(n.count_ones() == 0 || n.is_positive());
n
}
}
impl <U> FixedSqrt for $signed <UInt <U, B0>> where
UInt <U, B0> : $lt
{
fn sqrt (self) -> Self {
if self.is_negative() {
panic!("fixed point square root of a negative number");
}
let bits = self.to_bits() as $unsigned;
let sqrt = bits.integer_sqrt() <<
(<$signed <UInt <U, B0>> as Fixed>::Frac::USIZE/2);
let n = $signed::from_bits (sqrt
as <$signed <UInt <U, B0>> as Fixed>::Bits);
debug_assert!(n.count_ones() == 0 || n.is_positive());
n
}
}
}
}
macro_rules! impl_sqrt_signed_odd {
($signed:ident, $leq:ident, $unsigned:ty) => {
impl <U> FixedSqrt for $signed <UInt <U, B1>> where
UInt <U, B1> : $leq
{
fn sqrt (self) -> Self {
if self.is_negative() {
panic!("fixed point square root of a negative number");
}
debug_assert_eq!(
self.to_bits() &
(1 as <$signed <UInt <U, B1>> as Fixed>::Bits).rotate_right (1),
0x0);
let bits = (self.to_bits() << 1) as $unsigned;
let sqrt = bits.integer_sqrt() <<
(<$signed <UInt <U, B1>> as Fixed>::Frac::USIZE/2);
let n = $signed::from_bits (sqrt
as <$signed <UInt <U, B1>> as Fixed>::Bits);
debug_assert!(n.count_ones() == 0 || n.is_positive());
n
}
}
}
}
impl_sqrt_signed_even!(FixedI8, LtU8, u8);
impl_sqrt_signed_even!(FixedI16, LtU16, u16);
impl_sqrt_signed_even!(FixedI32, LtU32, u32);
impl_sqrt_signed_even!(FixedI64, LtU64, u64);
impl_sqrt_signed_even!(FixedI128, LtU128, u128);
impl_sqrt_signed_odd!(FixedI8, LeEqU8, u8);
impl_sqrt_signed_odd!(FixedI16, LeEqU16, u16);
impl_sqrt_signed_odd!(FixedI32, LeEqU32, u32);
impl_sqrt_signed_odd!(FixedI64, LeEqU64, u64);
impl_sqrt_signed_odd!(FixedI128, LeEqU128, u128);
#[cfg(test)]
mod tests {
use super::*;
use fixed::types::*;
use typenum::{Shright, Sub1};
#[test]
fn test_sqrt() {
let x = I16F16::from_num (2);
assert_eq!(x.sqrt(), I16F16::from_num (1.41406));
macro_rules! test_sqrt_unsigned {
( $fun_zero:ident, $fun_even:ident, $(($fun_odd:ident),)? $fixed:ident,
$unsigned:ident, $maxerr:expr
) => {
fn $fun_zero (base: f64, range: i32) {
for i in 0..range {
let h_f64 = base.powi(i);
let l_f64 = base.powi(-i);
if let Some (h) = $fixed::<U0>::checked_from_num(h_f64) {
let h_sqrt = h.sqrt();
let err = (h_f64.sqrt() - h_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <U0>::USIZE);
show!((ftype, h, h_sqrt, err));
assert!(err <= $maxerr);
}
}
if let Some (l) = $fixed::<U0>::checked_from_num(l_f64) {
let l_sqrt = l.sqrt();
let err = (l_f64.sqrt() - l_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <U0>::USIZE);
show!((ftype, l, l_sqrt, err));
assert!(err <= $maxerr);
}
}
}
}
fn $fun_even<U>(base: f64, range: i32) where
UInt <U, B0> : Unsigned + IsLessOrEqual<$unsigned, Output = True>
{
for i in 0..range {
let h_f64 = base.powi(i);
let l_f64 = base.powi(-i);
if let Some (h) = $fixed::<UInt <U, B0>>::checked_from_num(h_f64) {
let h_sqrt = h.sqrt();
let err = (h_f64.sqrt() - h_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B0>>::USIZE);
show!((ftype, h, h_sqrt, err));
assert!(err <= $maxerr);
}
}
if let Some (l) = $fixed::<UInt <U, B0>>::checked_from_num(l_f64) {
let l_sqrt = l.sqrt();
let err = (l_f64.sqrt() - l_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B0>>::USIZE);
show!((ftype, l, l_sqrt, err));
assert!(err <= $maxerr);
}
}
}
}
$(
fn $fun_odd<U>(base: f64, range: i32) where
UInt <U, B1> : Unsigned + IsLessOrEqual<$unsigned, Output = True>
{
for i in 0..range {
let h_f64 = base.powi(i);
let l_f64 = base.powi(-i);
if let Some (h) = $fixed::<UInt <U, B1>>::checked_from_num(h_f64) {
let h_sqrt = h.sqrt();
let err = (h_f64.sqrt() - h_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B1>>::USIZE);
show!((ftype, h, h_sqrt, err));
assert!(err <= $maxerr);
}
}
if let Some (l) = $fixed::<UInt <U, B1>>::checked_from_num(l_f64) {
let l_sqrt = l.sqrt();
let err = (l_f64.sqrt() - l_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B1>>::USIZE);
show!((ftype, l, l_sqrt, err));
assert!(err <= $maxerr);
}
}
}
}
)?
eprint!("testing {},", stringify!($fun_even));
$(
eprint!("{}", stringify!($fun_odd));
)?
eprintln!();
$fun_zero (0.5, $unsigned::I32);
$fun_zero (2.0, $unsigned::I32);
$fun_zero (2.5, $unsigned::I32/2);
$fun_zero (3.0, $unsigned::I32/2);
$fun_zero (5.0, $unsigned::I32/2);
$fun_even::<U0>(0.5, $unsigned::I32);
$fun_even::<U0>(2.0, $unsigned::I32);
$fun_even::<U0>(2.5, $unsigned::I32/2);
$fun_even::<U0>(3.0, $unsigned::I32/2);
$fun_even::<U0>(5.0, $unsigned::I32/2);
$(
$fun_odd::<U1>(0.5, $unsigned::I32);
$fun_odd::<U1>(2.0, $unsigned::I32);
$fun_odd::<U1>(2.5, $unsigned::I32/2);
$fun_odd::<U1>(3.0, $unsigned::I32/2);
$fun_odd::<U1>(5.0, $unsigned::I32/2);
)?
$fun_even::<U2>(0.5, $unsigned::I32);
$fun_even::<U2>(2.0, $unsigned::I32);
$fun_even::<U2>(2.5, $unsigned::I32/2);
$fun_even::<U2>(3.0, $unsigned::I32/2);
$fun_even::<U2>(5.0, $unsigned::I32/2);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(0.5, $unsigned::I32);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(2.0, $unsigned::I32);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(2.5, $unsigned::I32/2);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(3.0, $unsigned::I32/2);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(5.0, $unsigned::I32/2);
$(
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(0.5, $unsigned::I32);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(2.0, $unsigned::I32);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(2.5, $unsigned::I32/2);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(3.0, $unsigned::I32/2);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(5.0, $unsigned::I32/2);
)?
$fun_even::<Shright<$unsigned,U1>>(0.5, $unsigned::I32);
$fun_even::<Shright<$unsigned,U1>>(2.0, $unsigned::I32);
$fun_even::<Shright<$unsigned,U1>>(2.5, $unsigned::I32/2);
$fun_even::<Shright<$unsigned,U1>>(3.0, $unsigned::I32/2);
$fun_even::<Shright<$unsigned,U1>>(5.0, $unsigned::I32/2);
}
}
test_sqrt_unsigned!(test_sqrt_u128_zero, test_sqrt_u128_even, FixedU128,
U128, 8.0);
test_sqrt_unsigned!(test_sqrt_u64_zero, test_sqrt_u64_even,
(test_sqrt_u64_odd), FixedU64, U64, 1.0);
test_sqrt_unsigned!(test_sqrt_u32_zero, test_sqrt_u32_even,
(test_sqrt_u32_odd), FixedU32, U32, 1.0);
test_sqrt_unsigned!(test_sqrt_u16_zero, test_sqrt_u16_even,
(test_sqrt_u16_odd), FixedU16, U16, 1.0);
test_sqrt_unsigned!(test_sqrt_u8_zero, test_sqrt_u8_even,
(test_sqrt_u8_odd), FixedU8, U8, 1.0);
macro_rules! test_sqrt_signed {
( $fun_zero:ident, $fun_even:ident, $fun_odd:ident, $fixed:ident,
$unsigned:ident, $maxerr:expr
) => {
fn $fun_zero (base: f64, range: i32) {
for i in 0..range {
let h_f64 = base.powi(i);
let l_f64 = base.powi(-i);
if let Some (h) = $fixed::<U0>::checked_from_num(h_f64) {
let h_sqrt = h.sqrt();
let err = (h_f64.sqrt() - h_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <U0>::USIZE);
show!((ftype, h, h_sqrt, err));
assert!(err <= $maxerr);
}
}
if let Some (l) = $fixed::<U0>::checked_from_num(l_f64) {
let l_sqrt = l.sqrt();
let err = (l_f64.sqrt() - l_sqrt.to_num::<f64>()).abs();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <U0>::USIZE);
show!((ftype, l, l_sqrt, err));
assert!(err <= $maxerr);
}
}
}
}
fn $fun_even<U>(base: f64, range: i32) where
UInt <U, B0> : Unsigned + typenum::IsLess <$unsigned, Output = True> +
IsLessOrEqual <$unsigned, Output = True>
{
for i in 0..range {
let h_f64 = base.powi(i);
let l_f64 = base.powi(-i);
if let Some (h) = $fixed::<UInt <U, B0>>::checked_from_num(h_f64) {
if $fixed::<UInt <U, B0>>::checked_from_num(h_f64.sqrt())
.is_none()
{
continue
}
let h_sqrt = h.sqrt();
let err = h_f64.sqrt() - h_sqrt.to_num::<f64>();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B0>>::USIZE);
show!((ftype, h, h_sqrt, err));
assert!(err <= $maxerr);
}
}
if let Some (l) = $fixed::<UInt <U, B0>>::checked_from_num(l_f64) {
if $fixed::<UInt <U, B0>>::checked_from_num(l_f64.sqrt())
.is_none()
{
continue
}
let l_sqrt = l.sqrt();
let err = l_f64.sqrt() - l_sqrt.to_num::<f64>();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B0>>::USIZE);
show!((ftype, l, l_sqrt, err));
assert!(err <= $maxerr);
}
}
}
}
fn $fun_odd<U>(base: f64, range: i32) where
UInt <U, B1> : Unsigned + IsLessOrEqual<$unsigned, Output = True>
{
for i in 0..range {
let h_f64 = base.powi(i);
let l_f64 = base.powi(-i);
if let Some (h) = $fixed::<UInt <U, B1>>::checked_from_num(h_f64) {
if $fixed::<UInt <U, B1>>::checked_from_num(h_f64.sqrt())
.is_none()
{
continue
}
let h_sqrt = h.sqrt();
let err = h_f64.sqrt() - h_sqrt.to_num::<f64>();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B1>>::USIZE);
show!((ftype, h, h_sqrt, err));
assert!(err <= $maxerr);
}
}
if let Some (l) = $fixed::<UInt <U, B1>>::checked_from_num(l_f64) {
if $fixed::<UInt <U, B1>>::checked_from_num(l_f64.sqrt())
.is_none()
{
continue
}
let l_sqrt = l.sqrt();
let err = l_f64.sqrt() - l_sqrt.to_num::<f64>();
if err > $maxerr {
let ftype = format!("{}<U{}>",
stringify!($fixed), <UInt <U, B1>>::USIZE);
show!((ftype, l, l_sqrt, err));
assert!(err <= $maxerr);
}
}
}
}
$fun_zero (0.5, $unsigned::I32);
$fun_zero (2.0, $unsigned::I32);
$fun_zero (2.5, $unsigned::I32/2);
$fun_zero (3.0, $unsigned::I32/2);
$fun_zero (5.0, $unsigned::I32/2);
$fun_even::<U0>(0.5, $unsigned::I32);
$fun_even::<U0>(2.0, $unsigned::I32);
$fun_even::<U0>(2.5, $unsigned::I32/2);
$fun_even::<U0>(3.0, $unsigned::I32/2);
$fun_even::<U0>(5.0, $unsigned::I32/2);
$fun_odd::<U1>(0.5, $unsigned::I32);
$fun_odd::<U1>(2.0, $unsigned::I32);
$fun_odd::<U1>(2.5, $unsigned::I32/2);
$fun_odd::<U1>(3.0, $unsigned::I32/2);
$fun_odd::<U1>(5.0, $unsigned::I32/2);
$fun_even::<U2>(0.5, $unsigned::I32);
$fun_even::<U2>(2.0, $unsigned::I32);
$fun_even::<U2>(2.5, $unsigned::I32/2);
$fun_even::<U2>(3.0, $unsigned::I32/2);
$fun_even::<U2>(5.0, $unsigned::I32/2);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(0.5, $unsigned::I32);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(2.0, $unsigned::I32);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(2.5, $unsigned::I32/2);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(3.0, $unsigned::I32/2);
$fun_even::<Shright<Sub1<Sub1<$unsigned>>,U1>>(5.0, $unsigned::I32/2);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(0.5, $unsigned::I32);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(2.0, $unsigned::I32);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(2.5, $unsigned::I32/2);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(3.0, $unsigned::I32/2);
$fun_odd::<Shright<Sub1<$unsigned>,U1>>(5.0, $unsigned::I32/2);
}
}
test_sqrt_signed!(test_sqrt_i128_zero, test_sqrt_i128_even,
test_sqrt_i128_odd, FixedI128, U128, 8.0);
test_sqrt_signed!(test_sqrt_i64_zero, test_sqrt_i64_even, test_sqrt_i64_odd,
FixedI64, U64, 1.0);
test_sqrt_signed!(test_sqrt_i32_zero, test_sqrt_i32_even, test_sqrt_i32_odd,
FixedI32, U32, 1.0);
test_sqrt_signed!(test_sqrt_i16_zero, test_sqrt_i16_even, test_sqrt_i16_odd,
FixedI16, U16, 1.0);
test_sqrt_signed!(test_sqrt_i8_zero, test_sqrt_i8_even, test_sqrt_i8_odd,
FixedI8, U8, 1.0);
}
#[test]
#[should_panic]
fn test_sqrt_negative() {
I16F16::from_num (-1.0).sqrt();
}
#[test]
fn test_sqrt_max() {
I4F4::max_value().sqrt();
I8F8::max_value().sqrt();
I16F16::max_value().sqrt();
I32F32::max_value().sqrt();
I64F64::max_value().sqrt();
}
#[test]
fn test_sqrt_unsigned_exhaustive() {
macro_rules! test_unsigned_exhaustive {
($unsigned:ident, $maxerr:expr) => {
let mut i = $unsigned::from_bits (0);
loop {
let err = (i.to_num::<f64>().sqrt() - i.sqrt().to_num::<f64>()).abs();
if err >= $maxerr {
show!((stringify!($unsigned), i, i.sqrt(), err));
assert!(err < $maxerr);
}
if i == $unsigned::max_value() {
break
}
i += $unsigned::from_bits (1);
}
}
}
test_unsigned_exhaustive!(U8F0, 1.0);
test_unsigned_exhaustive!(U7F1, 1.0);
test_unsigned_exhaustive!(U6F2, 1.0);
test_unsigned_exhaustive!(U5F3, 1.0);
test_unsigned_exhaustive!(U4F4, 1.0);
test_unsigned_exhaustive!(U3F5, 1.0);
test_unsigned_exhaustive!(U2F6, 1.0);
test_unsigned_exhaustive!(U1F7, 1.0);
test_unsigned_exhaustive!(U0F8, 1.0);
test_unsigned_exhaustive!(U16F0, 1.0);
test_unsigned_exhaustive!(U15F1, 1.0);
test_unsigned_exhaustive!(U14F2, 1.0);
test_unsigned_exhaustive!(U13F3, 1.0);
test_unsigned_exhaustive!(U12F4, 1.0);
test_unsigned_exhaustive!(U11F5, 1.0);
test_unsigned_exhaustive!(U10F6, 1.0);
test_unsigned_exhaustive!(U9F7, 1.0);
test_unsigned_exhaustive!(U8F8, 1.0);
test_unsigned_exhaustive!(U7F9, 1.0);
test_unsigned_exhaustive!(U6F10, 1.0);
test_unsigned_exhaustive!(U5F11, 1.0);
test_unsigned_exhaustive!(U4F12, 1.0);
test_unsigned_exhaustive!(U3F13, 1.0);
test_unsigned_exhaustive!(U2F14, 1.0);
test_unsigned_exhaustive!(U1F15, 1.0);
test_unsigned_exhaustive!(U0F16, 1.0);
}
#[test]
fn test_sqrt_signed_exhaustive() {
macro_rules! test_signed_exhaustive {
($signed:ident, $maxerr:expr) => {
let mut i = $signed::from_bits (0);
loop {
let err = (i.to_num::<f64>().sqrt() - i.sqrt().to_num::<f64>()).abs();
if err >= $maxerr {
show!((stringify!($signed), i, i.sqrt(), err));
assert!(err < $maxerr);
}
if i == $signed::max_value() {
break
}
i += $signed::from_bits (1);
}
}
}
test_signed_exhaustive!(I8F0, 1.0);
test_signed_exhaustive!(I7F1, 1.0);
test_signed_exhaustive!(I6F2, 1.0);
test_signed_exhaustive!(I5F3, 1.0);
test_signed_exhaustive!(I4F4, 1.0);
test_signed_exhaustive!(I3F5, 1.0);
test_signed_exhaustive!(I2F6, 1.0);
test_signed_exhaustive!(I1F7, 1.0);
test_signed_exhaustive!(I16F0, 1.0);
test_signed_exhaustive!(I15F1, 1.0);
test_signed_exhaustive!(I14F2, 1.0);
test_signed_exhaustive!(I13F3, 1.0);
test_signed_exhaustive!(I12F4, 1.0);
test_signed_exhaustive!(I11F5, 1.0);
test_signed_exhaustive!(I10F6, 1.0);
test_signed_exhaustive!(I9F7, 1.0);
test_signed_exhaustive!(I8F8, 1.0);
test_signed_exhaustive!(I7F9, 1.0);
test_signed_exhaustive!(I6F10, 1.0);
test_signed_exhaustive!(I5F11, 1.0);
test_signed_exhaustive!(I4F12, 1.0);
test_signed_exhaustive!(I3F13, 1.0);
test_signed_exhaustive!(I2F14, 1.0);
test_signed_exhaustive!(I1F15, 1.0);
}
}