/* ---------------------------------------------------------------------------------------------------*/ /* Port of the Intel Decimal Floating-Point Math Library decimal128 type to Rust. */ /* decmathlib-rs - Copyright (C) 2023-2024 Carlos Guzmán Álvarez */ /* -------------------------------------------------------------------------------------------------- */ /* Licensed under the MIT license. See LICENSE file in the project root for full license information. */ /* -------------------------------------------------------------------------------------------------- */ /* Intel® Decimal Floating-Point Math Library - Copyright (c) 2018, Intel Corp. */ /* -------------------------------------------------------------------------------------------------- */ mod common; dec_test!(bid128_frexp_001, bid128_frexp, 0, 0x78000000000000000000000000000000u128, 0 , 0x78000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_002, bid128_frexp, 0, 0x7c000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_003, bid128_frexp, 0, 0xf8000000000000000000000000000000u128, 0 , 0xf8000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_004, bid128_frexp, 0, 0xfc000000000000000000000000000000u128, 0 , 0xfc000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_005, bid128_frexp, 0, 0x00000000000000000000000000000001u128, -6175, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinDen dec_test!(bid128_frexp_006, bid128_frexp, 0, 0x00420000000000000000000000000001u128, -6142, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinNorm dec_test!(bid128_frexp_007, bid128_frexp, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- 1-ulp dec_test!(bid128_frexp_008, bid128_frexp, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- Max dec_test!(bid128_frexp_009, bid128_frexp, 0, 0x80000000000000000000000000000001u128, -6175, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinDen dec_test!(bid128_frexp_010, bid128_frexp, 0, 0x80420000000000000000000000000001u128, -6142, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinNorm dec_test!(bid128_frexp_011, bid128_frexp, 0, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -(1-ulp) dec_test!(bid128_frexp_012, bid128_frexp, 0, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -Max dec_test!(bid128_frexp_013, bid128_frexp, 1, 0x00000000000000000000000000000001u128, -6175, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinDen dec_test!(bid128_frexp_014, bid128_frexp, 1, 0x00420000000000000000000000000001u128, -6142, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinNorm dec_test!(bid128_frexp_015, bid128_frexp, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- 1-ulp dec_test!(bid128_frexp_016, bid128_frexp, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- Max dec_test!(bid128_frexp_017, bid128_frexp, 1, 0x80000000000000000000000000000001u128, -6175, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinDen dec_test!(bid128_frexp_018, bid128_frexp, 1, 0x80420000000000000000000000000001u128, -6142, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinNorm dec_test!(bid128_frexp_019, bid128_frexp, 1, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -(1-ulp) dec_test!(bid128_frexp_020, bid128_frexp, 1, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -Max dec_test!(bid128_frexp_021, bid128_frexp, 2, 0x00000000000000000000000000000001u128, -6175, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinDen dec_test!(bid128_frexp_022, bid128_frexp, 2, 0x00420000000000000000000000000001u128, -6142, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinNorm dec_test!(bid128_frexp_023, bid128_frexp, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- 1-ulp dec_test!(bid128_frexp_024, bid128_frexp, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- Max dec_test!(bid128_frexp_025, bid128_frexp, 2, 0x80000000000000000000000000000001u128, -6175, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinDen dec_test!(bid128_frexp_026, bid128_frexp, 2, 0x80420000000000000000000000000001u128, -6142, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinNorm dec_test!(bid128_frexp_027, bid128_frexp, 2, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -(1-ulp) dec_test!(bid128_frexp_028, bid128_frexp, 2, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -Max dec_test!(bid128_frexp_029, bid128_frexp, 3, 0x00000000000000000000000000000001u128, -6175, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinDen dec_test!(bid128_frexp_030, bid128_frexp, 3, 0x00420000000000000000000000000001u128, -6142, 0x303E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- MinNorm dec_test!(bid128_frexp_031, bid128_frexp, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- 1-ulp dec_test!(bid128_frexp_032, bid128_frexp, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- Max dec_test!(bid128_frexp_033, bid128_frexp, 3, 0x80000000000000000000000000000001u128, -6175, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinDen dec_test!(bid128_frexp_034, bid128_frexp, 3, 0x80420000000000000000000000000001u128, -6142, 0xB03E0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- -MinNorm dec_test!(bid128_frexp_035, bid128_frexp, 3, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -(1-ulp) dec_test!(bid128_frexp_036, bid128_frexp, 3, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 6145 , 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- -Max dec_test!(bid128_frexp_037, bid128_frexp, 0, 0x00000000000000000000000000000000u128, 0 , 0x00000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_038, bid128_frexp, 0, 0x7e000000000000000000000000000000u128, 0 , 0x7c000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_039, bid128_frexp, 0, 0x80000000000000000000000000000000u128, 0 , 0x80000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_040, bid128_frexp, 0, 0xfe000000000000000000000000000000u128, 0 , 0xfc000000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_041, bid128_frexp, 0, 0x481432060a2e154fd148002010000018u128, 3084 , 0x2ffc32060a2e154fd148002010000018u128, 0x00); dec_test!(bid128_frexp_042, bid128_frexp, 0, 0x68d8f80c42c232ffc59ac8aa0a9a9cf1u128, 0 , 0x23620000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_043, bid128_frexp, 0, 0x000000000000000008004a4900205082u128, -6158, 0x301c00000000000008004a4900205082u128, 0x00); dec_test!(bid128_frexp_044, bid128_frexp, 0, 0x481432060a2e154fd148002010000018u128, 3084 , 0x2ffc32060a2e154fd148002010000018u128, 0x00); dec_test!(bid128_frexp_045, bid128_frexp, 0, 0x68d8f80c42c232ffc59ac8aa0a9a9cf1u128, 0 , 0x23620000000000000000000000000000u128, 0x00); dec_test!(bid128_frexp_046, bid128_frexp, 0, 0x000000000000000008004a4900205082u128, -6158, 0x301c00000000000008004a4900205082u128, 0x00); dec_test!(bid128_frexp_047, bid128_frexp, 0, 0x30400000000000000000000000000001u128, 1 , 0x303e0000000000000000000000000001u128, 0x00);