From c9a0fb72d1caaae73be2bceff03f724feef1708e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Guzm=C3=A1n=20=C3=81lvarez?= Date: Sun, 4 Feb 2024 06:45:16 +0100 Subject: [PATCH 1/2] bid128_ldexp --- src/bid128_ldexp.rs | 88 ++++++++ src/bid128_scalbn.rs | 17 +- src/d128.rs | 6 + src/lib.rs | 2 +- tests/bid128_ldexp.rs | 510 ++++++++++++++++++++++++++++++++++++++++++ tests/common/mod.rs | 14 ++ 6 files changed, 626 insertions(+), 11 deletions(-) create mode 100644 src/bid128_ldexp.rs create mode 100644 tests/bid128_ldexp.rs diff --git a/src/bid128_ldexp.rs b/src/bid128_ldexp.rs new file mode 100644 index 0000000..5d6278e --- /dev/null +++ b/src/bid128_ldexp.rs @@ -0,0 +1,88 @@ +/* ----------------------------------------------------------------------------- */ +/* decimal128 type from Intel decimal math library port to Rust. */ +/* decmathlib-rs - Copyright (C) 2023-2024 Carlos Guzmán Álvarez */ +/* ----------------------------------------------------------------------------- */ +/* Intel® Decimal Floating-Point Math Library - Copyright (c) 2018, Intel Corp. */ +/* ----------------------------------------------------------------------------- */ + +#![allow(unused_assignments)] +#![allow(non_camel_case_types)] +#![allow(non_upper_case_globals)] +#![allow(non_snake_case)] +#![allow(dead_code)] +#![allow(unused_mut)] + +use crate::bid_internal::{__add_128_128, __set_status_flags, bid_get_BID128, bid_get_BID128_very_fast, unpack_BID128_value}; +use crate::constants::{DECIMAL_MAX_EXPON_128, QUIET_MASK64, SNAN_MASK64}; +use crate::core::StatusFlags; +use crate::d128::{_IDEC_flags, BID_SINT64, BID_UINT128, BID_UINT32, BID_UINT64}; + +pub (crate) fn bid128_ldexp(x: &BID_UINT128, n: i32, rnd_mode: u32, pfpsf: &mut _IDEC_flags) -> BID_UINT128 { + let mut CX: BID_UINT128 = BID_UINT128::default(); + let mut CX2: BID_UINT128 = BID_UINT128::default(); + let mut CBID_X8: BID_UINT128 = BID_UINT128::default(); + let mut res: BID_UINT128 = BID_UINT128::default(); + let mut exp64: BID_SINT64; + let mut sign_x: BID_UINT64 = 0; + let mut exponent_x: i32 = 0; + + // unpack arguments, check for NaN or Infinity + if unpack_BID128_value(&mut sign_x, &mut exponent_x, &mut CX, x) == 0 { + // x is Inf. or NaN or 0 + if (x.w[1] & SNAN_MASK64) == SNAN_MASK64 { // y is sNaN + __set_status_flags(pfpsf, StatusFlags::BID_INVALID_EXCEPTION); + } + res.w[1] = CX.w[1] & QUIET_MASK64; + res.w[0] = CX.w[0]; + if CX.w[1] == 0 { + exp64 = (exponent_x as BID_SINT64) + (n as BID_SINT64); + if exp64 < 0 { + exp64 = 0; + } + if exp64 > DECIMAL_MAX_EXPON_128 as i64 { + exp64 = DECIMAL_MAX_EXPON_128 as BID_SINT64; + }; + exponent_x = exp64 as i32; + bid_get_BID128_very_fast(&mut res, sign_x, exponent_x, &CX); + } + return res; + } + + exp64 = (exponent_x as BID_SINT64) + (n as BID_SINT64); + exponent_x = exp64 as i32; + + if (exponent_x as BID_UINT32) <= DECIMAL_MAX_EXPON_128 as u32 { + bid_get_BID128_very_fast(&mut res, sign_x, exponent_x, &CX); + return res; + } + // check for overflow + if exp64 > DECIMAL_MAX_EXPON_128 as i64 { + if CX.w[1] < 0x314dc6448d93u64 { + // try to normalize coefficient + loop { + CBID_X8.w[1] = (CX.w[1] << 3) | (CX.w[0] >> 61); + CBID_X8.w[0] = CX.w[0] << 3; + CX2.w[1] = (CX.w[1] << 1) | (CX.w[0] >> 63); + CX2.w[0] = CX.w[0] << 1; + CX = __add_128_128(&CX2, &CBID_X8); + + exponent_x -= 1; + exp64 -= 1; + + if ! (CX.w[1] < 0x314dc6448d93u64 && exp64 > DECIMAL_MAX_EXPON_128 as i64) { + break; + } + } + } + if exp64 <= DECIMAL_MAX_EXPON_128 as i64 { + bid_get_BID128_very_fast(&mut res, sign_x, exponent_x, &CX); + return res; + } else { + exponent_x = 0x7fffffff; // overflow + } + } + // exponent < 0 + // the BID pack routine will round the coefficient + res = bid_get_BID128(sign_x, exponent_x, &CX, rnd_mode, pfpsf); + return res; +} \ No newline at end of file diff --git a/src/bid128_scalbn.rs b/src/bid128_scalbn.rs index 35cc0a9..eba6abe 100644 --- a/src/bid128_scalbn.rs +++ b/src/bid128_scalbn.rs @@ -12,13 +12,10 @@ #![allow(overflowing_literals)] use crate::bid_internal::{__add_128_128, __set_status_flags, bid_get_BID128, bid_get_BID128_very_fast, unpack_BID128_value}; -use crate::constants::{QUIET_MASK64, SNAN_MASK64}; +use crate::constants::{DECIMAL_MAX_EXPON_128, QUIET_MASK64, SNAN_MASK64}; use crate::core::StatusFlags; use crate::d128::{_IDEC_flags, BID_SINT64, BID_UINT128, BID_UINT32, BID_UINT64}; -const DECIMAL_EXPONENT_BIAS_128: i64 = 6176; -const MAX_DECIMAL_EXPONENT_128: i64 = 12287; - pub (crate) fn bid128_scalbn(x: &BID_UINT128, n: i32, rnd_mode: u32, pfpsf: &mut _IDEC_flags) -> BID_UINT128 { let mut CX: BID_UINT128 = BID_UINT128::default(); let mut CX2: BID_UINT128 = BID_UINT128::default(); @@ -41,8 +38,8 @@ pub (crate) fn bid128_scalbn(x: &BID_UINT128, n: i32, rnd_mode: u32, pfpsf: &mut if exp64 < 0 { exp64 = 0; } - if exp64 > MAX_DECIMAL_EXPONENT_128 { - exp64 = MAX_DECIMAL_EXPONENT_128; + if exp64 > DECIMAL_MAX_EXPON_128 as i64 { + exp64 = DECIMAL_MAX_EXPON_128 as BID_SINT64; } exponent_x = exp64 as i32; bid_get_BID128_very_fast(&mut res, sign_x, exponent_x, &CX); @@ -53,12 +50,12 @@ pub (crate) fn bid128_scalbn(x: &BID_UINT128, n: i32, rnd_mode: u32, pfpsf: &mut exp64 = (exponent_x as BID_SINT64) + (n as BID_SINT64); exponent_x = exp64 as i32; - if (exponent_x as BID_UINT32) <= (MAX_DECIMAL_EXPONENT_128 as BID_UINT32) { + if (exponent_x as BID_UINT32) <= (DECIMAL_MAX_EXPON_128 as BID_UINT32) { bid_get_BID128_very_fast(&mut res, sign_x, exponent_x, &CX); return res; } // check for overflow - if exp64 > MAX_DECIMAL_EXPONENT_128 { + if exp64 > DECIMAL_MAX_EXPON_128 as i64 { if CX.w[1] < 0x314dc6448d93u64 { // try to normalize coefficient loop { @@ -71,12 +68,12 @@ pub (crate) fn bid128_scalbn(x: &BID_UINT128, n: i32, rnd_mode: u32, pfpsf: &mut exponent_x -= 1; exp64 -= 1; - if !(CX.w[1] < 0x314dc6448d93u64 && exp64 > MAX_DECIMAL_EXPONENT_128) { + if !(CX.w[1] < 0x314dc6448d93u64 && exp64 > DECIMAL_MAX_EXPON_128 as i64) { break; } } } - if exp64 <= MAX_DECIMAL_EXPONENT_128 { + if exp64 <= DECIMAL_MAX_EXPON_128 as i64 { bid_get_BID128_very_fast (&mut res, sign_x, exponent_x, &CX); return res; } else { diff --git a/src/d128.rs b/src/d128.rs index f992f8a..5f45fcf 100644 --- a/src/d128.rs +++ b/src/d128.rs @@ -15,6 +15,7 @@ use std::str::FromStr; use crate::bid128_add::{bid128_add, bid128_sub}; use crate::bid128_compare::{bid128_quiet_equal, bid128_quiet_greater, bid128_quiet_greater_equal, bid128_quiet_less, bid128_quiet_less_equal, bid128_quiet_not_equal}; use crate::bid128_div::bid128_div; +use crate::bid128_ldexp::bid128_ldexp; use crate::bid128_mul::bid128_mul; use crate::bid128_noncomp::*; @@ -257,6 +258,11 @@ impl d128 { bid128_scalbln(self, n, rnd_mode.unwrap_or(DEFAULT_ROUNDING_MODE), pfpsf) } + /// multiply a 128-bit decimal floating-point value by an integral power of 2. + pub fn ldexp(&self, n: i32, rnd_mode: Option, pfpsf: &mut _IDEC_flags) -> Self { + bid128_ldexp(self, n, rnd_mode.unwrap_or(DEFAULT_ROUNDING_MODE), pfpsf) + } + /// Convert 128-bit decimal floating-point value to 64-bit decimal floating-point format (binary encoding) pub fn to_decimal64(&self, rnd_mode: Option, status: &mut _IDEC_flags) -> decimal64 { bid128_to_bid64(self, rnd_mode.unwrap_or(DEFAULT_ROUNDING_MODE), status) diff --git a/src/lib.rs b/src/lib.rs index acb218a..6e316cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,4 +29,4 @@ mod bid_round; mod constants; mod convert; pub mod core; -pub mod d128;mod bid128_scalbn;mod bid128_scalbln; \ No newline at end of file +pub mod d128;mod bid128_scalbn;mod bid128_scalbln;mod bid128_ldexp; \ No newline at end of file diff --git a/tests/bid128_ldexp.rs b/tests/bid128_ldexp.rs new file mode 100644 index 0000000..6536039 --- /dev/null +++ b/tests/bid128_ldexp.rs @@ -0,0 +1,510 @@ +/* ----------------------------------------------------------------------------- */ +/* decimal128 type from Intel decimal math library port to Rust. */ +/* decmathlib-rs - Copyright (C) 2023-2024 Carlos Guzmán Álvarez */ +/* ----------------------------------------------------------------------------- */ +/* Intel® Decimal Floating-Point Math Library - Copyright (c) 2018 Intel Corp. */ +/* ----------------------------------------------------------------------------- */ + +mod common; + +dec_test!(bid128_ldexp_001, bid128_ldexp, 0, 0x00000000000000000000000000000000u128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_002, bid128_ldexp, 0, 0x00000000000000000000000000000000u128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_003, bid128_ldexp, 0, 0x00000000000000000000000000000000u128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_004, bid128_ldexp, 0, 0x00000000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_005, bid128_ldexp, 0, 0x00000000000000000000000000000001u128, 0 , 0x00000000000000000000000000000001u128, 0x00); // ulp =0.0000000000 +dec_test!(bid128_ldexp_006, bid128_ldexp, 0, 0x00000000000000000000000000000001u128, -1 , 0x00000000000000000000000000000000u128, 0x30); // ulp=.1000000000 +dec_test!(bid128_ldexp_007, bid128_ldexp, 0, 0x00000000000000000000000000000005u128, -1 , 0x00000000000000000000000000000000u128, 0x30); // ulp=.5000000000 +dec_test!(bid128_ldexp_008, bid128_ldexp, 0, 0x0001ed09bead87c0378d8e64ffffffffu128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_009, bid128_ldexp, 0, 0x0001ed09bead87c0378d8e64ffffffffu128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_010, bid128_ldexp, 0, 0x0001ed09bead87c0378d8e64ffffffffu128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_011, bid128_ldexp, 0, 0x0001ed09bead87c0378d8e64ffffffffu128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_012, bid128_ldexp, 0, 0x003e0000000000000000000000000000u128, 0 , 0x003e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_013, bid128_ldexp, 0, 0x003e0000000000000000000000000000u128, -1 , 0x003c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_014, bid128_ldexp, 0, 0x003e0000000000000000000000000000u128, 1 , 0x00400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_015, bid128_ldexp, 0, 0x003e0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_016, bid128_ldexp, 0, 0x00840000000000000000000000000000u128, 0 , 0x00840000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_017, bid128_ldexp, 0, 0x00840000000000000000000000000000u128, -1 , 0x00820000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_018, bid128_ldexp, 0, 0x00840000000000000000000000000000u128, 1 , 0x00860000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_019, bid128_ldexp, 0, 0x00840000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_020, bid128_ldexp, 0, 0x2d240000000000000000000000000000u128, 0 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_021, bid128_ldexp, 0, 0x2d240000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_022, bid128_ldexp, 0, 0x2d240000000000000000000000000000u128, -1 , 0x2d220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_023, bid128_ldexp, 0, 0x2d240000000000000000000000000000u128, 1 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_024, bid128_ldexp, 0, 0x2d260000000000000000000000000000u128, 0 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_025, bid128_ldexp, 0, 0x2d260000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_026, bid128_ldexp, 0, 0x2d260000000000000000000000000000u128, -1 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_027, bid128_ldexp, 0, 0x2d260000000000000000000000000000u128, 1 , 0x2d280000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_028, bid128_ldexp, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_029, bid128_ldexp, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -1 , 0x2FFBED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_030, bid128_ldexp, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x2FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_031, bid128_ldexp, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 2147483647 , 0x78000000000000000000000000000000u128, 0x28); // ulp=0.00000 +dec_test!(bid128_ldexp_032, bid128_ldexp, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -2147483648, 0x00000000000000000000000000000000u128, 0x30); // ulp=0.0000000000 +dec_test!(bid128_ldexp_033, bid128_ldexp, 0, 0x30200000000000000000000000000000u128, 0 , 0x30200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_034, bid128_ldexp, 0, 0x30200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_035, bid128_ldexp, 0, 0x30200000000000000000000000000000u128, -1 , 0x301e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_036, bid128_ldexp, 0, 0x30200000000000000000000000000000u128, 1 , 0x30220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_037, bid128_ldexp, 0, 0x33200000000000000000000000000000u128, 0 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_038, bid128_ldexp, 0, 0x33200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_039, bid128_ldexp, 0, 0x33200000000000000000000000000000u128, -1 , 0x331e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_040, bid128_ldexp, 0, 0x33200000000000000000000000000000u128, 1 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_041, bid128_ldexp, 0, 0x33220000000000000000000000000000u128, 0 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_042, bid128_ldexp, 0, 0x33220000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_043, bid128_ldexp, 0, 0x33220000000000000000000000000000u128, -1 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_044, bid128_ldexp, 0, 0x33220000000000000000000000000000u128, 1 , 0x33240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_045, bid128_ldexp, 0, 0x5ffa0000000000000000000000000000u128, 0 , 0x5ffa0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_046, bid128_ldexp, 0, 0x5ffa0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_047, bid128_ldexp, 0, 0x5ffa0000000000000000000000000000u128, -1 , 0x5ff80000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_048, bid128_ldexp, 0, 0x5ffa0000000000000000000000000000u128, 1 , 0x5ffc0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_049, bid128_ldexp, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_050, bid128_ldexp, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x78000000000000000000000000000000u128, 0x28); // ulp=0.0000000000 +dec_test!(bid128_ldexp_051, bid128_ldexp, 0, 0x6003b75d7734cd9e1234567890123456u128, 0 , 0x000e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_052, bid128_ldexp, 0, 0x6003b75d7734cd9e1234567890123456u128, -1 , 0x000c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_053, bid128_ldexp, 0, 0x6003b75d7734cd9e1234567890123456u128, 1 , 0x00100000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_054, bid128_ldexp, 0, 0x6003b75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_055, bid128_ldexp, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0 , 0x276e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_056, bid128_ldexp, 0, 0x69dbb75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_057, bid128_ldexp, 0, 0x69dbb75d7734cd9e1234567890123456u128, -1 , 0x276c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_058, bid128_ldexp, 0, 0x69dbb75d7734cd9e1234567890123456u128, 1 , 0x27700000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_059, bid128_ldexp, 0, 0x78000000000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_060, bid128_ldexp, 0, 0x78000000000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_061, bid128_ldexp, 0, 0x78000000000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_062, bid128_ldexp, 0, 0x78000000000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_063, bid128_ldexp, 0, 0x78000001000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_064, bid128_ldexp, 0, 0x78000001000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_065, bid128_ldexp, 0, 0x78000001000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_066, bid128_ldexp, 0, 0x78000001000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_067, bid128_ldexp, 0, 0x7c000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_068, bid128_ldexp, 0, 0x7c000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_069, bid128_ldexp, 0, 0x7c000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_070, bid128_ldexp, 0, 0x7c000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_071, bid128_ldexp, 0, 0x7c000001000000000000000000000000u128, 0 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_072, bid128_ldexp, 0, 0x7c000001000000000000000000000000u128, 12336256 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_073, bid128_ldexp, 0, 0x7c000001000000000000000000000000u128, -1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_074, bid128_ldexp, 0, 0x7c000001000000000000000000000000u128, 1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_075, bid128_ldexp, 0, 0x7e000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_076, bid128_ldexp, 0, 0x7e000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_077, bid128_ldexp, 0, 0x7e000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_078, bid128_ldexp, 0, 0x7e000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_079, bid128_ldexp, 0, 0x7e003fffffffefffffffffffffffffffu128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_080, bid128_ldexp, 0, 0x7e003fffffffefffffffffffffffffffu128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_081, bid128_ldexp, 0, 0x7e003fffffffefffffffffffffffffffu128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_082, bid128_ldexp, 0, 0x7e003fffffffefffffffffffffffffffu128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_083, bid128_ldexp, 0, 0x7ef00000000000000000000000000001u128, 0 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_084, bid128_ldexp, 0, 0x7ef00000000000000000000000000001u128, 12336256 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_085, bid128_ldexp, 0, 0x7ef00000000000000000000000000001u128, -1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_086, bid128_ldexp, 0, 0x7ef00000000000000000000000000001u128, 1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_087, bid128_ldexp, 0, 0xad240000000000000000000000000000u128, 0 , 0xad240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_088, bid128_ldexp, 0, 0xad240000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_089, bid128_ldexp, 0, 0xad240000000000000000000000000000u128, -1 , 0xad220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_090, bid128_ldexp, 0, 0xad240000000000000000000000000000u128, 1 , 0xad260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_091, bid128_ldexp, 0, 0xad3e0000000000000000000000000000u128, 0 , 0xad3e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_092, bid128_ldexp, 0, 0xad3e0000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_093, bid128_ldexp, 0, 0xad3e0000000000000000000000000000u128, -1 , 0xad3c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_094, bid128_ldexp, 0, 0xad3e0000000000000000000000000000u128, 1 , 0xad400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_095, bid128_ldexp, 0, 0xb0200000000000000000000000000000u128, 0 , 0xb0200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_096, bid128_ldexp, 0, 0xb0200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_097, bid128_ldexp, 0, 0xb0200000000000000000000000000000u128, -1 , 0xb01e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_098, bid128_ldexp, 0, 0xb0200000000000000000000000000000u128, 1 , 0xb0220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_099, bid128_ldexp, 0, 0xb3200000000000000000000000000000u128, 0 , 0xb3200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_100, bid128_ldexp, 0, 0xb3200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_101, bid128_ldexp, 0, 0xb3200000000000000000000000000000u128, -1 , 0xb31e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_102, bid128_ldexp, 0, 0xb3200000000000000000000000000000u128, 1 , 0xb3220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_103, bid128_ldexp, 1, 0x00000000000000000000000000000000u128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_104, bid128_ldexp, 1, 0x00000000000000000000000000000000u128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_105, bid128_ldexp, 1, 0x00000000000000000000000000000000u128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_106, bid128_ldexp, 1, 0x00000000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_107, bid128_ldexp, 1, 0x00000000000000000000000000000001u128, 0 , 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_108, bid128_ldexp, 1, 0x00000000000000000000000000000001u128, -1 , 0x00000000000000000000000000000000u128, 0x30); // ulp=.1000000000 +dec_test!(bid128_ldexp_109, bid128_ldexp, 1, 0x00000000000000000000000000000005u128, -1 , 0x00000000000000000000000000000000u128, 0x30); // ulp=.5000000000 +dec_test!(bid128_ldexp_110, bid128_ldexp, 1, 0x0001ed09bead87c0378d8e64ffffffffu128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_111, bid128_ldexp, 1, 0x0001ed09bead87c0378d8e64ffffffffu128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_112, bid128_ldexp, 1, 0x0001ed09bead87c0378d8e64ffffffffu128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_113, bid128_ldexp, 1, 0x0001ed09bead87c0378d8e64ffffffffu128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_114, bid128_ldexp, 1, 0x003e0000000000000000000000000000u128, 0 , 0x003e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_115, bid128_ldexp, 1, 0x003e0000000000000000000000000000u128, -1 , 0x003c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_116, bid128_ldexp, 1, 0x003e0000000000000000000000000000u128, 1 , 0x00400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_117, bid128_ldexp, 1, 0x003e0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_118, bid128_ldexp, 1, 0x00840000000000000000000000000000u128, 0 , 0x00840000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_119, bid128_ldexp, 1, 0x00840000000000000000000000000000u128, -1 , 0x00820000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_120, bid128_ldexp, 1, 0x00840000000000000000000000000000u128, 1 , 0x00860000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_121, bid128_ldexp, 1, 0x00840000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_122, bid128_ldexp, 1, 0x2d240000000000000000000000000000u128, 0 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_123, bid128_ldexp, 1, 0x2d240000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_124, bid128_ldexp, 1, 0x2d240000000000000000000000000000u128, -1 , 0x2d220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_125, bid128_ldexp, 1, 0x2d240000000000000000000000000000u128, 1 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_126, bid128_ldexp, 1, 0x2d260000000000000000000000000000u128, 0 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_127, bid128_ldexp, 1, 0x2d260000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_128, bid128_ldexp, 1, 0x2d260000000000000000000000000000u128, -1 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_129, bid128_ldexp, 1, 0x2d260000000000000000000000000000u128, 1 , 0x2d280000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_130, bid128_ldexp, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_131, bid128_ldexp, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -1 , 0x2FFBED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_132, bid128_ldexp, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x2FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_133, bid128_ldexp, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 2147483647 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x28); // ulp=0.00000 +dec_test!(bid128_ldexp_134, bid128_ldexp, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -2147483648, 0x00000000000000000000000000000000u128, 0x30); // ulp=0.0000000000 +dec_test!(bid128_ldexp_135, bid128_ldexp, 1, 0x30200000000000000000000000000000u128, 0 , 0x30200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_136, bid128_ldexp, 1, 0x30200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_137, bid128_ldexp, 1, 0x30200000000000000000000000000000u128, -1 , 0x301e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_138, bid128_ldexp, 1, 0x30200000000000000000000000000000u128, 1 , 0x30220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_139, bid128_ldexp, 1, 0x33200000000000000000000000000000u128, 0 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_140, bid128_ldexp, 1, 0x33200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_141, bid128_ldexp, 1, 0x33200000000000000000000000000000u128, -1 , 0x331e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_142, bid128_ldexp, 1, 0x33200000000000000000000000000000u128, 1 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_143, bid128_ldexp, 1, 0x33220000000000000000000000000000u128, 0 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_144, bid128_ldexp, 1, 0x33220000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_145, bid128_ldexp, 1, 0x33220000000000000000000000000000u128, -1 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_146, bid128_ldexp, 1, 0x33220000000000000000000000000000u128, 1 , 0x33240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_147, bid128_ldexp, 1, 0x5ffa0000000000000000000000000000u128, 0 , 0x5ffa0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_148, bid128_ldexp, 1, 0x5ffa0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_149, bid128_ldexp, 1, 0x5ffa0000000000000000000000000000u128, -1 , 0x5ff80000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_150, bid128_ldexp, 1, 0x5ffa0000000000000000000000000000u128, 1 , 0x5ffc0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_151, bid128_ldexp, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_152, bid128_ldexp, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x28); // ulp=0.0000000000 +dec_test!(bid128_ldexp_153, bid128_ldexp, 1, 0x6003b75d7734cd9e1234567890123456u128, 0 , 0x000e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_154, bid128_ldexp, 1, 0x6003b75d7734cd9e1234567890123456u128, -1 , 0x000c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_155, bid128_ldexp, 1, 0x6003b75d7734cd9e1234567890123456u128, 1 , 0x00100000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_156, bid128_ldexp, 1, 0x6003b75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_157, bid128_ldexp, 1, 0x69dbb75d7734cd9e1234567890123456u128, 0 , 0x276e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_158, bid128_ldexp, 1, 0x69dbb75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_159, bid128_ldexp, 1, 0x69dbb75d7734cd9e1234567890123456u128, -1 , 0x276c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_160, bid128_ldexp, 1, 0x69dbb75d7734cd9e1234567890123456u128, 1 , 0x27700000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_161, bid128_ldexp, 1, 0x78000000000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_162, bid128_ldexp, 1, 0x78000000000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_163, bid128_ldexp, 1, 0x78000000000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_164, bid128_ldexp, 1, 0x78000000000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_165, bid128_ldexp, 1, 0x78000001000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_166, bid128_ldexp, 1, 0x78000001000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_167, bid128_ldexp, 1, 0x78000001000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_168, bid128_ldexp, 1, 0x78000001000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_169, bid128_ldexp, 1, 0x7c000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_170, bid128_ldexp, 1, 0x7c000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_171, bid128_ldexp, 1, 0x7c000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_172, bid128_ldexp, 1, 0x7c000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_173, bid128_ldexp, 1, 0x7c000001000000000000000000000000u128, 0 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_174, bid128_ldexp, 1, 0x7c000001000000000000000000000000u128, 12336256 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_175, bid128_ldexp, 1, 0x7c000001000000000000000000000000u128, -1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_176, bid128_ldexp, 1, 0x7c000001000000000000000000000000u128, 1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_177, bid128_ldexp, 1, 0x7e000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_178, bid128_ldexp, 1, 0x7e000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_179, bid128_ldexp, 1, 0x7e000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_180, bid128_ldexp, 1, 0x7e000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_181, bid128_ldexp, 1, 0x7e003fffffffefffffffffffffffffffu128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_182, bid128_ldexp, 1, 0x7e003fffffffefffffffffffffffffffu128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_183, bid128_ldexp, 1, 0x7e003fffffffefffffffffffffffffffu128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_184, bid128_ldexp, 1, 0x7e003fffffffefffffffffffffffffffu128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_185, bid128_ldexp, 1, 0x7ef00000000000000000000000000001u128, 0 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_186, bid128_ldexp, 1, 0x7ef00000000000000000000000000001u128, 12336256 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_187, bid128_ldexp, 1, 0x7ef00000000000000000000000000001u128, -1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_188, bid128_ldexp, 1, 0x7ef00000000000000000000000000001u128, 1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_189, bid128_ldexp, 1, 0xad240000000000000000000000000000u128, 0 , 0xad240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_190, bid128_ldexp, 1, 0xad240000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_191, bid128_ldexp, 1, 0xad240000000000000000000000000000u128, -1 , 0xad220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_192, bid128_ldexp, 1, 0xad240000000000000000000000000000u128, 1 , 0xad260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_193, bid128_ldexp, 1, 0xad3e0000000000000000000000000000u128, 0 , 0xad3e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_194, bid128_ldexp, 1, 0xad3e0000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_195, bid128_ldexp, 1, 0xad3e0000000000000000000000000000u128, -1 , 0xad3c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_196, bid128_ldexp, 1, 0xad3e0000000000000000000000000000u128, 1 , 0xad400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_197, bid128_ldexp, 1, 0xb0200000000000000000000000000000u128, 0 , 0xb0200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_198, bid128_ldexp, 1, 0xb0200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_199, bid128_ldexp, 1, 0xb0200000000000000000000000000000u128, -1 , 0xb01e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_200, bid128_ldexp, 1, 0xb0200000000000000000000000000000u128, 1 , 0xb0220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_201, bid128_ldexp, 1, 0xb3200000000000000000000000000000u128, 0 , 0xb3200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_202, bid128_ldexp, 1, 0xb3200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_203, bid128_ldexp, 1, 0xb3200000000000000000000000000000u128, -1 , 0xb31e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_204, bid128_ldexp, 1, 0xb3200000000000000000000000000000u128, 1 , 0xb3220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_205, bid128_ldexp, 2, 0x00000000000000000000000000000000u128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_206, bid128_ldexp, 2, 0x00000000000000000000000000000000u128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_207, bid128_ldexp, 2, 0x00000000000000000000000000000000u128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_208, bid128_ldexp, 2, 0x00000000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_209, bid128_ldexp, 2, 0x00000000000000000000000000000001u128, 0 , 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_210, bid128_ldexp, 2, 0x00000000000000000000000000000001u128, -1 , 0x00000000000000000000000000000001u128, 0x30); // ulp=-.9000000000 +dec_test!(bid128_ldexp_211, bid128_ldexp, 2, 0x00000000000000000000000000000005u128, -1 , 0x00000000000000000000000000000001u128, 0x30); // ulp=-.500000000 +dec_test!(bid128_ldexp_212, bid128_ldexp, 2, 0x0001ed09bead87c0378d8e64ffffffffu128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_213, bid128_ldexp, 2, 0x0001ed09bead87c0378d8e64ffffffffu128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_214, bid128_ldexp, 2, 0x0001ed09bead87c0378d8e64ffffffffu128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_215, bid128_ldexp, 2, 0x0001ed09bead87c0378d8e64ffffffffu128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_216, bid128_ldexp, 2, 0x003e0000000000000000000000000000u128, 0 , 0x003e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_217, bid128_ldexp, 2, 0x003e0000000000000000000000000000u128, -1 , 0x003c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_218, bid128_ldexp, 2, 0x003e0000000000000000000000000000u128, 1 , 0x00400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_219, bid128_ldexp, 2, 0x003e0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_220, bid128_ldexp, 2, 0x00840000000000000000000000000000u128, 0 , 0x00840000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_221, bid128_ldexp, 2, 0x00840000000000000000000000000000u128, -1 , 0x00820000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_222, bid128_ldexp, 2, 0x00840000000000000000000000000000u128, 1 , 0x00860000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_223, bid128_ldexp, 2, 0x00840000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_224, bid128_ldexp, 2, 0x2d240000000000000000000000000000u128, 0 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_225, bid128_ldexp, 2, 0x2d240000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_226, bid128_ldexp, 2, 0x2d240000000000000000000000000000u128, -1 , 0x2d220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_227, bid128_ldexp, 2, 0x2d240000000000000000000000000000u128, 1 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_228, bid128_ldexp, 2, 0x2d260000000000000000000000000000u128, 0 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_229, bid128_ldexp, 2, 0x2d260000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_230, bid128_ldexp, 2, 0x2d260000000000000000000000000000u128, -1 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_231, bid128_ldexp, 2, 0x2d260000000000000000000000000000u128, 1 , 0x2d280000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_232, bid128_ldexp, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_233, bid128_ldexp, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -1 , 0x2FFBED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_234, bid128_ldexp, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x2FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_235, bid128_ldexp, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 2147483647 , 0x78000000000000000000000000000000u128, 0x28); // ulp=0.00000 +dec_test!(bid128_ldexp_236, bid128_ldexp, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -2147483648, 0x00000000000000000000000000000001u128, 0x30); // ulp=-1.000000000 +dec_test!(bid128_ldexp_237, bid128_ldexp, 2, 0x30200000000000000000000000000000u128, 0 , 0x30200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_238, bid128_ldexp, 2, 0x30200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_239, bid128_ldexp, 2, 0x30200000000000000000000000000000u128, -1 , 0x301e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_240, bid128_ldexp, 2, 0x30200000000000000000000000000000u128, 1 , 0x30220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_241, bid128_ldexp, 2, 0x33200000000000000000000000000000u128, 0 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_242, bid128_ldexp, 2, 0x33200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_243, bid128_ldexp, 2, 0x33200000000000000000000000000000u128, -1 , 0x331e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_244, bid128_ldexp, 2, 0x33200000000000000000000000000000u128, 1 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_245, bid128_ldexp, 2, 0x33220000000000000000000000000000u128, 0 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_246, bid128_ldexp, 2, 0x33220000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_247, bid128_ldexp, 2, 0x33220000000000000000000000000000u128, -1 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_248, bid128_ldexp, 2, 0x33220000000000000000000000000000u128, 1 , 0x33240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_249, bid128_ldexp, 2, 0x5ffa0000000000000000000000000000u128, 0 , 0x5ffa0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_250, bid128_ldexp, 2, 0x5ffa0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_251, bid128_ldexp, 2, 0x5ffa0000000000000000000000000000u128, -1 , 0x5ff80000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_252, bid128_ldexp, 2, 0x5ffa0000000000000000000000000000u128, 1 , 0x5ffc0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_253, bid128_ldexp, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_254, bid128_ldexp, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x78000000000000000000000000000000u128, 0x28); // ulp=0.0000000000 +dec_test!(bid128_ldexp_255, bid128_ldexp, 2, 0x6003b75d7734cd9e1234567890123456u128, 0 , 0x000e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_256, bid128_ldexp, 2, 0x6003b75d7734cd9e1234567890123456u128, -1 , 0x000c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_257, bid128_ldexp, 2, 0x6003b75d7734cd9e1234567890123456u128, 1 , 0x00100000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_258, bid128_ldexp, 2, 0x6003b75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_259, bid128_ldexp, 2, 0x69dbb75d7734cd9e1234567890123456u128, 0 , 0x276e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_260, bid128_ldexp, 2, 0x69dbb75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_261, bid128_ldexp, 2, 0x69dbb75d7734cd9e1234567890123456u128, -1 , 0x276c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_262, bid128_ldexp, 2, 0x69dbb75d7734cd9e1234567890123456u128, 1 , 0x27700000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_263, bid128_ldexp, 2, 0x78000000000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_264, bid128_ldexp, 2, 0x78000000000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_265, bid128_ldexp, 2, 0x78000000000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_266, bid128_ldexp, 2, 0x78000000000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_267, bid128_ldexp, 2, 0x78000001000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_268, bid128_ldexp, 2, 0x78000001000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_269, bid128_ldexp, 2, 0x78000001000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_270, bid128_ldexp, 2, 0x78000001000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_271, bid128_ldexp, 2, 0x7c000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_272, bid128_ldexp, 2, 0x7c000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_273, bid128_ldexp, 2, 0x7c000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_274, bid128_ldexp, 2, 0x7c000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_275, bid128_ldexp, 2, 0x7c000001000000000000000000000000u128, 0 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_276, bid128_ldexp, 2, 0x7c000001000000000000000000000000u128, 12336256 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_277, bid128_ldexp, 2, 0x7c000001000000000000000000000000u128, -1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_278, bid128_ldexp, 2, 0x7c000001000000000000000000000000u128, 1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_279, bid128_ldexp, 2, 0x7e000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_280, bid128_ldexp, 2, 0x7e000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_281, bid128_ldexp, 2, 0x7e000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_282, bid128_ldexp, 2, 0x7e000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_283, bid128_ldexp, 2, 0x7e003fffffffefffffffffffffffffffu128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_284, bid128_ldexp, 2, 0x7e003fffffffefffffffffffffffffffu128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_285, bid128_ldexp, 2, 0x7e003fffffffefffffffffffffffffffu128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_286, bid128_ldexp, 2, 0x7e003fffffffefffffffffffffffffffu128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_287, bid128_ldexp, 2, 0x7ef00000000000000000000000000001u128, 0 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_288, bid128_ldexp, 2, 0x7ef00000000000000000000000000001u128, 12336256 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_289, bid128_ldexp, 2, 0x7ef00000000000000000000000000001u128, -1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_290, bid128_ldexp, 2, 0x7ef00000000000000000000000000001u128, 1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_291, bid128_ldexp, 2, 0xad240000000000000000000000000000u128, 0 , 0xad240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_292, bid128_ldexp, 2, 0xad240000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_293, bid128_ldexp, 2, 0xad240000000000000000000000000000u128, -1 , 0xad220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_294, bid128_ldexp, 2, 0xad240000000000000000000000000000u128, 1 , 0xad260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_295, bid128_ldexp, 2, 0xad3e0000000000000000000000000000u128, 0 , 0xad3e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_296, bid128_ldexp, 2, 0xad3e0000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_297, bid128_ldexp, 2, 0xad3e0000000000000000000000000000u128, -1 , 0xad3c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_298, bid128_ldexp, 2, 0xad3e0000000000000000000000000000u128, 1 , 0xad400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_299, bid128_ldexp, 2, 0xb0200000000000000000000000000000u128, 0 , 0xb0200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_300, bid128_ldexp, 2, 0xb0200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_301, bid128_ldexp, 2, 0xb0200000000000000000000000000000u128, -1 , 0xb01e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_302, bid128_ldexp, 2, 0xb0200000000000000000000000000000u128, 1 , 0xb0220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_303, bid128_ldexp, 2, 0xb3200000000000000000000000000000u128, 0 , 0xb3200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_304, bid128_ldexp, 2, 0xb3200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_305, bid128_ldexp, 2, 0xb3200000000000000000000000000000u128, -1 , 0xb31e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_306, bid128_ldexp, 2, 0xb3200000000000000000000000000000u128, 1 , 0xb3220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_307, bid128_ldexp, 3, 0x00000000000000000000000000000000u128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_308, bid128_ldexp, 3, 0x00000000000000000000000000000000u128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_309, bid128_ldexp, 3, 0x00000000000000000000000000000000u128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_310, bid128_ldexp, 3, 0x00000000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_311, bid128_ldexp, 3, 0x00000000000000000000000000000001u128, 0 , 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_312, bid128_ldexp, 3, 0x00000000000000000000000000000001u128, -1 , 0x00000000000000000000000000000000u128, 0x30); // ulp=.1000000000 +dec_test!(bid128_ldexp_313, bid128_ldexp, 3, 0x00000000000000000000000000000005u128, -1 , 0x00000000000000000000000000000000u128, 0x30); // ulp=.5000000000 +dec_test!(bid128_ldexp_314, bid128_ldexp, 3, 0x0001ed09bead87c0378d8e64ffffffffu128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_315, bid128_ldexp, 3, 0x0001ed09bead87c0378d8e64ffffffffu128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_316, bid128_ldexp, 3, 0x0001ed09bead87c0378d8e64ffffffffu128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_317, bid128_ldexp, 3, 0x0001ed09bead87c0378d8e64ffffffffu128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_318, bid128_ldexp, 3, 0x003e0000000000000000000000000000u128, 0 , 0x003e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_319, bid128_ldexp, 3, 0x003e0000000000000000000000000000u128, -1 , 0x003c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_320, bid128_ldexp, 3, 0x003e0000000000000000000000000000u128, 1 , 0x00400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_321, bid128_ldexp, 3, 0x003e0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_322, bid128_ldexp, 3, 0x00840000000000000000000000000000u128, 0 , 0x00840000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_323, bid128_ldexp, 3, 0x00840000000000000000000000000000u128, -1 , 0x00820000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_324, bid128_ldexp, 3, 0x00840000000000000000000000000000u128, 1 , 0x00860000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_325, bid128_ldexp, 3, 0x00840000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_326, bid128_ldexp, 3, 0x2d240000000000000000000000000000u128, 0 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_327, bid128_ldexp, 3, 0x2d240000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_328, bid128_ldexp, 3, 0x2d240000000000000000000000000000u128, -1 , 0x2d220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_329, bid128_ldexp, 3, 0x2d240000000000000000000000000000u128, 1 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_330, bid128_ldexp, 3, 0x2d260000000000000000000000000000u128, 0 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_331, bid128_ldexp, 3, 0x2d260000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_332, bid128_ldexp, 3, 0x2d260000000000000000000000000000u128, -1 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_333, bid128_ldexp, 3, 0x2d260000000000000000000000000000u128, 1 , 0x2d280000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_334, bid128_ldexp, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_335, bid128_ldexp, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -1 , 0x2FFBED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_336, bid128_ldexp, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x2FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_337, bid128_ldexp, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 2147483647 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x28); // ulp=0.00000 +dec_test!(bid128_ldexp_338, bid128_ldexp, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, -2147483648, 0x00000000000000000000000000000000u128, 0x30); // ulp=0.0000000000 +dec_test!(bid128_ldexp_339, bid128_ldexp, 3, 0x30200000000000000000000000000000u128, 0 , 0x30200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_340, bid128_ldexp, 3, 0x30200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_341, bid128_ldexp, 3, 0x30200000000000000000000000000000u128, -1 , 0x301e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_342, bid128_ldexp, 3, 0x30200000000000000000000000000000u128, 1 , 0x30220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_343, bid128_ldexp, 3, 0x33200000000000000000000000000000u128, 0 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_344, bid128_ldexp, 3, 0x33200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_345, bid128_ldexp, 3, 0x33200000000000000000000000000000u128, -1 , 0x331e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_346, bid128_ldexp, 3, 0x33200000000000000000000000000000u128, 1 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_347, bid128_ldexp, 3, 0x33220000000000000000000000000000u128, 0 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_348, bid128_ldexp, 3, 0x33220000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_349, bid128_ldexp, 3, 0x33220000000000000000000000000000u128, -1 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_350, bid128_ldexp, 3, 0x33220000000000000000000000000000u128, 1 , 0x33240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_351, bid128_ldexp, 3, 0x5ffa0000000000000000000000000000u128, 0 , 0x5ffa0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_352, bid128_ldexp, 3, 0x5ffa0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_353, bid128_ldexp, 3, 0x5ffa0000000000000000000000000000u128, -1 , 0x5ff80000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_354, bid128_ldexp, 3, 0x5ffa0000000000000000000000000000u128, 1 , 0x5ffc0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_355, bid128_ldexp, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 +dec_test!(bid128_ldexp_356, bid128_ldexp, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 1 , 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x28); // ulp=0.0000000000 +dec_test!(bid128_ldexp_357, bid128_ldexp, 3, 0x6003b75d7734cd9e1234567890123456u128, 0 , 0x000e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_358, bid128_ldexp, 3, 0x6003b75d7734cd9e1234567890123456u128, -1 , 0x000c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_359, bid128_ldexp, 3, 0x6003b75d7734cd9e1234567890123456u128, 1 , 0x00100000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_360, bid128_ldexp, 3, 0x6003b75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_361, bid128_ldexp, 3, 0x69dbb75d7734cd9e1234567890123456u128, 0 , 0x276e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_362, bid128_ldexp, 3, 0x69dbb75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_363, bid128_ldexp, 3, 0x69dbb75d7734cd9e1234567890123456u128, -1 , 0x276c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_364, bid128_ldexp, 3, 0x69dbb75d7734cd9e1234567890123456u128, 1 , 0x27700000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_365, bid128_ldexp, 3, 0x78000000000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_366, bid128_ldexp, 3, 0x78000000000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_367, bid128_ldexp, 3, 0x78000000000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_368, bid128_ldexp, 3, 0x78000000000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_369, bid128_ldexp, 3, 0x78000001000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_370, bid128_ldexp, 3, 0x78000001000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_371, bid128_ldexp, 3, 0x78000001000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_372, bid128_ldexp, 3, 0x78000001000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_373, bid128_ldexp, 3, 0x7c000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_374, bid128_ldexp, 3, 0x7c000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_375, bid128_ldexp, 3, 0x7c000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_376, bid128_ldexp, 3, 0x7c000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_377, bid128_ldexp, 3, 0x7c000001000000000000000000000000u128, 0 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_378, bid128_ldexp, 3, 0x7c000001000000000000000000000000u128, 12336256 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_379, bid128_ldexp, 3, 0x7c000001000000000000000000000000u128, -1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_380, bid128_ldexp, 3, 0x7c000001000000000000000000000000u128, 1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_381, bid128_ldexp, 3, 0x7e000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_382, bid128_ldexp, 3, 0x7e000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_383, bid128_ldexp, 3, 0x7e000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_384, bid128_ldexp, 3, 0x7e000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_385, bid128_ldexp, 3, 0x7e003fffffffefffffffffffffffffffu128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_386, bid128_ldexp, 3, 0x7e003fffffffefffffffffffffffffffu128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_387, bid128_ldexp, 3, 0x7e003fffffffefffffffffffffffffffu128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_388, bid128_ldexp, 3, 0x7e003fffffffefffffffffffffffffffu128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_389, bid128_ldexp, 3, 0x7ef00000000000000000000000000001u128, 0 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_390, bid128_ldexp, 3, 0x7ef00000000000000000000000000001u128, 12336256 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_391, bid128_ldexp, 3, 0x7ef00000000000000000000000000001u128, -1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_392, bid128_ldexp, 3, 0x7ef00000000000000000000000000001u128, 1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_393, bid128_ldexp, 3, 0xad240000000000000000000000000000u128, 0 , 0xad240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_394, bid128_ldexp, 3, 0xad240000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_395, bid128_ldexp, 3, 0xad240000000000000000000000000000u128, -1 , 0xad220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_396, bid128_ldexp, 3, 0xad240000000000000000000000000000u128, 1 , 0xad260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_397, bid128_ldexp, 3, 0xad3e0000000000000000000000000000u128, 0 , 0xad3e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_398, bid128_ldexp, 3, 0xad3e0000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_399, bid128_ldexp, 3, 0xad3e0000000000000000000000000000u128, -1 , 0xad3c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_400, bid128_ldexp, 3, 0xad3e0000000000000000000000000000u128, 1 , 0xad400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_401, bid128_ldexp, 3, 0xb0200000000000000000000000000000u128, 0 , 0xb0200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_402, bid128_ldexp, 3, 0xb0200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_403, bid128_ldexp, 3, 0xb0200000000000000000000000000000u128, -1 , 0xb01e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_404, bid128_ldexp, 3, 0xb0200000000000000000000000000000u128, 1 , 0xb0220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_405, bid128_ldexp, 3, 0xb3200000000000000000000000000000u128, 0 , 0xb3200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_406, bid128_ldexp, 3, 0xb3200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_407, bid128_ldexp, 3, 0xb3200000000000000000000000000000u128, -1 , 0xb31e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_408, bid128_ldexp, 3, 0xb3200000000000000000000000000000u128, 1 , 0xb3220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_409, bid128_ldexp, 4, 0x00000000000000000000000000000000u128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_410, bid128_ldexp, 4, 0x00000000000000000000000000000000u128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_411, bid128_ldexp, 4, 0x00000000000000000000000000000000u128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_412, bid128_ldexp, 4, 0x00000000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_413, bid128_ldexp, 4, 0x00000000000000000000000000000005u128, -1 , 0x00000000000000000000000000000001u128, 0x30); // ulp=-.500000000 +dec_test!(bid128_ldexp_414, bid128_ldexp, 4, 0x0001ed09bead87c0378d8e64ffffffffu128, 0 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_415, bid128_ldexp, 4, 0x0001ed09bead87c0378d8e64ffffffffu128, -1 , 0x00000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_416, bid128_ldexp, 4, 0x0001ed09bead87c0378d8e64ffffffffu128, 1 , 0x00020000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_417, bid128_ldexp, 4, 0x0001ed09bead87c0378d8e64ffffffffu128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_418, bid128_ldexp, 4, 0x003e0000000000000000000000000000u128, 0 , 0x003e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_419, bid128_ldexp, 4, 0x003e0000000000000000000000000000u128, -1 , 0x003c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_420, bid128_ldexp, 4, 0x003e0000000000000000000000000000u128, 1 , 0x00400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_421, bid128_ldexp, 4, 0x003e0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_422, bid128_ldexp, 4, 0x00840000000000000000000000000000u128, 0 , 0x00840000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_423, bid128_ldexp, 4, 0x00840000000000000000000000000000u128, -1 , 0x00820000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_424, bid128_ldexp, 4, 0x00840000000000000000000000000000u128, 1 , 0x00860000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_425, bid128_ldexp, 4, 0x00840000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_426, bid128_ldexp, 4, 0x2d240000000000000000000000000000u128, 0 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_427, bid128_ldexp, 4, 0x2d240000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_428, bid128_ldexp, 4, 0x2d240000000000000000000000000000u128, -1 , 0x2d220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_429, bid128_ldexp, 4, 0x2d240000000000000000000000000000u128, 1 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_430, bid128_ldexp, 4, 0x2d260000000000000000000000000000u128, 0 , 0x2d260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_431, bid128_ldexp, 4, 0x2d260000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_432, bid128_ldexp, 4, 0x2d260000000000000000000000000000u128, -1 , 0x2d240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_433, bid128_ldexp, 4, 0x2d260000000000000000000000000000u128, 1 , 0x2d280000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_434, bid128_ldexp, 4, 0x30200000000000000000000000000000u128, 0 , 0x30200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_435, bid128_ldexp, 4, 0x30200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_436, bid128_ldexp, 4, 0x30200000000000000000000000000000u128, -1 , 0x301e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_437, bid128_ldexp, 4, 0x30200000000000000000000000000000u128, 1 , 0x30220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_438, bid128_ldexp, 4, 0x33200000000000000000000000000000u128, 0 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_439, bid128_ldexp, 4, 0x33200000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_440, bid128_ldexp, 4, 0x33200000000000000000000000000000u128, -1 , 0x331e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_441, bid128_ldexp, 4, 0x33200000000000000000000000000000u128, 1 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_442, bid128_ldexp, 4, 0x33220000000000000000000000000000u128, 0 , 0x33220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_443, bid128_ldexp, 4, 0x33220000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_444, bid128_ldexp, 4, 0x33220000000000000000000000000000u128, -1 , 0x33200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_445, bid128_ldexp, 4, 0x33220000000000000000000000000000u128, 1 , 0x33240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_446, bid128_ldexp, 4, 0x5ffa0000000000000000000000000000u128, 0 , 0x5ffa0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_447, bid128_ldexp, 4, 0x5ffa0000000000000000000000000000u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_448, bid128_ldexp, 4, 0x5ffa0000000000000000000000000000u128, -1 , 0x5ff80000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_449, bid128_ldexp, 4, 0x5ffa0000000000000000000000000000u128, 1 , 0x5ffc0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_450, bid128_ldexp, 4, 0x6003b75d7734cd9e1234567890123456u128, 0 , 0x000e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_451, bid128_ldexp, 4, 0x6003b75d7734cd9e1234567890123456u128, -1 , 0x000c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_452, bid128_ldexp, 4, 0x6003b75d7734cd9e1234567890123456u128, 1 , 0x00100000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_453, bid128_ldexp, 4, 0x6003b75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_454, bid128_ldexp, 4, 0x69dbb75d7734cd9e1234567890123456u128, 0 , 0x276e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_455, bid128_ldexp, 4, 0x69dbb75d7734cd9e1234567890123456u128, 12336256 , 0x5ffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_456, bid128_ldexp, 4, 0x69dbb75d7734cd9e1234567890123456u128, -1 , 0x276c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_457, bid128_ldexp, 4, 0x69dbb75d7734cd9e1234567890123456u128, 1 , 0x27700000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_458, bid128_ldexp, 4, 0x78000000000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_459, bid128_ldexp, 4, 0x78000000000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_460, bid128_ldexp, 4, 0x78000000000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_461, bid128_ldexp, 4, 0x78000000000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_462, bid128_ldexp, 4, 0x78000001000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_463, bid128_ldexp, 4, 0x78000001000000000000000000000000u128, 12336256 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_464, bid128_ldexp, 4, 0x78000001000000000000000000000000u128, -1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_465, bid128_ldexp, 4, 0x78000001000000000000000000000000u128, 1 , 0x78000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_466, bid128_ldexp, 4, 0x7c000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_467, bid128_ldexp, 4, 0x7c000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_468, bid128_ldexp, 4, 0x7c000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_469, bid128_ldexp, 4, 0x7c000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_470, bid128_ldexp, 4, 0x7c000001000000000000000000000000u128, 0 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_471, bid128_ldexp, 4, 0x7c000001000000000000000000000000u128, 12336256 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_472, bid128_ldexp, 4, 0x7c000001000000000000000000000000u128, -1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_473, bid128_ldexp, 4, 0x7c000001000000000000000000000000u128, 1 , 0x7c000001000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_474, bid128_ldexp, 4, 0x7e000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_475, bid128_ldexp, 4, 0x7e000000000000000000000000000000u128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_476, bid128_ldexp, 4, 0x7e000000000000000000000000000000u128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_477, bid128_ldexp, 4, 0x7e000000000000000000000000000000u128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_478, bid128_ldexp, 4, 0x7e003fffffffefffffffffffffffffffu128, 0 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_479, bid128_ldexp, 4, 0x7e003fffffffefffffffffffffffffffu128, 12336256 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_480, bid128_ldexp, 4, 0x7e003fffffffefffffffffffffffffffu128, -1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_481, bid128_ldexp, 4, 0x7e003fffffffefffffffffffffffffffu128, 1 , 0x7c000000000000000000000000000000u128, 0x01); +dec_test!(bid128_ldexp_482, bid128_ldexp, 4, 0x7ef00000000000000000000000000001u128, 0 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_483, bid128_ldexp, 4, 0x7ef00000000000000000000000000001u128, 12336256 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_484, bid128_ldexp, 4, 0x7ef00000000000000000000000000001u128, -1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_485, bid128_ldexp, 4, 0x7ef00000000000000000000000000001u128, 1 , 0x7c000000000000000000000000000001u128, 0x01); +dec_test!(bid128_ldexp_486, bid128_ldexp, 4, 0xad240000000000000000000000000000u128, 0 , 0xad240000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_487, bid128_ldexp, 4, 0xad240000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_488, bid128_ldexp, 4, 0xad240000000000000000000000000000u128, -1 , 0xad220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_489, bid128_ldexp, 4, 0xad240000000000000000000000000000u128, 1 , 0xad260000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_490, bid128_ldexp, 4, 0xad3e0000000000000000000000000000u128, 0 , 0xad3e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_491, bid128_ldexp, 4, 0xad3e0000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_492, bid128_ldexp, 4, 0xad3e0000000000000000000000000000u128, -1 , 0xad3c0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_493, bid128_ldexp, 4, 0xad3e0000000000000000000000000000u128, 1 , 0xad400000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_494, bid128_ldexp, 4, 0xb0200000000000000000000000000000u128, 0 , 0xb0200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_495, bid128_ldexp, 4, 0xb0200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_496, bid128_ldexp, 4, 0xb0200000000000000000000000000000u128, -1 , 0xb01e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_497, bid128_ldexp, 4, 0xb0200000000000000000000000000000u128, 1 , 0xb0220000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_498, bid128_ldexp, 4, 0xb3200000000000000000000000000000u128, 0 , 0xb3200000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_499, bid128_ldexp, 4, 0xb3200000000000000000000000000000u128, 12336256 , 0xdffe0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_500, bid128_ldexp, 4, 0xb3200000000000000000000000000000u128, -1 , 0xb31e0000000000000000000000000000u128, 0x00); +dec_test!(bid128_ldexp_501, bid128_ldexp, 4, 0xb3200000000000000000000000000000u128, 1 , 0xb3220000000000000000000000000000u128, 0x00); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 2e3b149..f2aa680 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -216,6 +216,20 @@ macro_rules! dec_test { } }; + ($name:ident, bid128_ldexp, $rnd_mode:expr, $input1:expr, $n:expr, $exp:expr, $exp_status:expr) => { + #[test] + fn $name() { + let mut status: decmathlib_rs::d128::_IDEC_flags = 0; + let rnd_mode = Some($rnd_mode); + let dec1 = decmathlib_rs::d128::d128::from($input1); + let exp = decmathlib_rs::d128::d128::from($exp); + let res1 = dec1.ldexp($n, rnd_mode, &mut status); + + assert_eq!(exp, res1); + assert_eq!($exp_status, status) + } + }; + ($name:ident, bid128_mul, $rnd_mode:expr, $input1:expr, $input2:expr, $exp:expr, $exp_status:expr) => { #[test] fn $name() { From 90b7ac9fbac1f5ab5ac1e79ca72455113291fd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Guzm=C3=A1n=20=C3=81lvarez?= Date: Sun, 4 Feb 2024 07:00:19 +0100 Subject: [PATCH 2/2] bid128_ldexp --- src/d128.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d128.rs b/src/d128.rs index 5f45fcf..1a5bcc2 100644 --- a/src/d128.rs +++ b/src/d128.rs @@ -105,7 +105,7 @@ pub struct BID_UINT128 { pub type d128 = BID_UINT128; #[macro_export] -macro_rules! d128 { +macro_rules! dec128 { ($t:tt) => {{ $crate::d128::d128::from_str(stringify!($t)).expect("Invalid decimal number literal") }}