/* ---------------------------------------------------------------------------------------------------*/ /* 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_modf_001, bid128_modf, 0, 0x7c000000000000000000000000000000u128, 0x7c000000000000000000000000000000u128, 0x7c000000000000000000000000000000u128, 0x00); dec_test!(bid128_modf_002, bid128_modf, 0, 0x7e000000000000000000000000000000u128, 0x7c000000000000000000000000000000u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_modf_003, bid128_modf, 0, 0xfc000000000000000000000000000000u128, 0xfc000000000000000000000000000000u128, 0xfc000000000000000000000000000000u128, 0x00); dec_test!(bid128_modf_004, bid128_modf, 0, 0xfe000000000000000000000000000000u128, 0xfc000000000000000000000000000000u128, 0xfc000000000000000000000000000000u128, 0x01); dec_test!(bid128_modf_005, bid128_modf, 0, 0x2FFE314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000001u128, 0x2FFE0000000000000000000000000001u128, 0x00); // -- 1+ulp dec_test!(bid128_modf_006, bid128_modf, 0, 0xAFFE314DC6448D9338C15B0A00000001u128, 0xB0400000000000000000000000000001u128, 0xAFFE0000000000000000000000000001u128, 0x00); // -- -(1+ulp) dec_test!(bid128_modf_007, bid128_modf, 1, 0x2FFE314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000001u128, 0x2FFE0000000000000000000000000001u128, 0x00); // -- 1+ulp dec_test!(bid128_modf_008, bid128_modf, 1, 0xAFFE314DC6448D9338C15B0A00000001u128, 0xB0400000000000000000000000000001u128, 0xAFFE0000000000000000000000000001u128, 0x00); // -- -(1+ulp) dec_test!(bid128_modf_009, bid128_modf, 2, 0x2FFE314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000001u128, 0x2FFE0000000000000000000000000001u128, 0x00); // -- 1+ulp dec_test!(bid128_modf_010, bid128_modf, 2, 0xAFFE314DC6448D9338C15B0A00000001u128, 0xB0400000000000000000000000000001u128, 0xAFFE0000000000000000000000000001u128, 0x00); // -- -(1+ulp) dec_test!(bid128_modf_011, bid128_modf, 3, 0x2FFE314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000001u128, 0x2FFE0000000000000000000000000001u128, 0x00); // -- 1+ulp dec_test!(bid128_modf_012, bid128_modf, 3, 0xAFFE314DC6448D9338C15B0A00000001u128, 0xB0400000000000000000000000000001u128, 0xAFFE0000000000000000000000000001u128, 0x00); // -- -(1+ulp) dec_test!(bid128_modf_013, bid128_modf, 0, 0x00000000000000000000000000000001u128, 0x30400000000000000000000000000000u128, 0x00000000000000000000000000000001u128, 0x00); // -- MinDen dec_test!(bid128_modf_014, bid128_modf, 0, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- MinNorm-ulp dec_test!(bid128_modf_015, bid128_modf, 0, 0x0000314DC6448D9338C15B0A00000000u128, 0x30400000000000000000000000000000u128, 0x0000314dc6448d9338c15b0a00000000u128, 0x00); // -- MinNorm dec_test!(bid128_modf_016, bid128_modf, 0, 0x0000314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000001u128, 0x00); // -- MinNorm+ulp dec_test!(bid128_modf_017, bid128_modf, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- 1-ulp dec_test!(bid128_modf_018, bid128_modf, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // -- Max dec_test!(bid128_modf_019, bid128_modf, 0, 0x78000000000000000000000000000000u128, 0x78000000000000000000000000000000u128, 0x5ffe0000000000000000000000000000u128, 0x00); dec_test!(bid128_modf_020, bid128_modf, 0, 0x80000000000000000000000000000001u128, 0xb0400000000000000000000000000000u128, 0x80000000000000000000000000000001u128, 0x00); // -- -(MinDen) dec_test!(bid128_modf_021, bid128_modf, 0, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- -(MinNorm-ulp) dec_test!(bid128_modf_022, bid128_modf, 0, 0x8000314DC6448D9338C15B0A00000000u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000000u128, 0x00); // -- -(MinNorm) dec_test!(bid128_modf_023, bid128_modf, 0, 0x8000314DC6448D9338C15B0A00000001u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000001u128, 0x00); // -- -(MinNorm+ulp) dec_test!(bid128_modf_024, bid128_modf, 0, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- -(1-ulp) dec_test!(bid128_modf_025, bid128_modf, 0, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // -- -(Max) dec_test!(bid128_modf_026, bid128_modf, 0, 0xf8000000000000000000000000000000u128, 0xf8000000000000000000000000000000u128, 0xdffe0000000000000000000000000000u128, 0x00); dec_test!(bid128_modf_027, bid128_modf, 1, 0x00000000000000000000000000000001u128, 0x30400000000000000000000000000000u128, 0x00000000000000000000000000000001u128, 0x00); // -- MinDen dec_test!(bid128_modf_028, bid128_modf, 1, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- MinNorm-ulp dec_test!(bid128_modf_029, bid128_modf, 1, 0x0000314DC6448D9338C15B0A00000000u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000000u128, 0x00); // -- MinNorm dec_test!(bid128_modf_030, bid128_modf, 1, 0x0000314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000001u128, 0x00); // -- MinNorm+ulp dec_test!(bid128_modf_031, bid128_modf, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- 1-ulp dec_test!(bid128_modf_032, bid128_modf, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // -- Max dec_test!(bid128_modf_033, bid128_modf, 1, 0x80000000000000000000000000000001u128, 0xb0400000000000000000000000000000u128, 0x80000000000000000000000000000001u128, 0x00); // -- -(MinDen) dec_test!(bid128_modf_034, bid128_modf, 1, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- -(MinNorm-ulp) dec_test!(bid128_modf_035, bid128_modf, 1, 0x8000314DC6448D9338C15B0A00000000u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000000u128, 0x00); // -- -(MinNorm) dec_test!(bid128_modf_036, bid128_modf, 1, 0x8000314DC6448D9338C15B0A00000001u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000001u128, 0x00); // -- -(MinNorm+ulp) dec_test!(bid128_modf_037, bid128_modf, 1, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- -(1-ulp) dec_test!(bid128_modf_038, bid128_modf, 1, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // -- -(Max) dec_test!(bid128_modf_039, bid128_modf, 2, 0x00000000000000000000000000000001u128, 0x30400000000000000000000000000000u128, 0x00000000000000000000000000000001u128, 0x00); // -- MinDen dec_test!(bid128_modf_040, bid128_modf, 2, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- MinNorm-ulp dec_test!(bid128_modf_041, bid128_modf, 2, 0x0000314DC6448D9338C15B0A00000000u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000000u128, 0x00); // -- MinNorm dec_test!(bid128_modf_042, bid128_modf, 2, 0x0000314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000001u128, 0x00); // -- MinNorm+ulp dec_test!(bid128_modf_043, bid128_modf, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- 1-ulp dec_test!(bid128_modf_044, bid128_modf, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // -- Max dec_test!(bid128_modf_045, bid128_modf, 2, 0x80000000000000000000000000000001u128, 0xb0400000000000000000000000000000u128, 0x80000000000000000000000000000001u128, 0x00); // -- -(MinDen) dec_test!(bid128_modf_046, bid128_modf, 2, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- -(MinNorm-ulp) dec_test!(bid128_modf_047, bid128_modf, 2, 0x8000314DC6448D9338C15B0A00000000u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000000u128, 0x00); // -- -(MinNorm) dec_test!(bid128_modf_048, bid128_modf, 2, 0x8000314DC6448D9338C15B0A00000001u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000001u128, 0x00); // -- -(MinNorm+ulp) dec_test!(bid128_modf_049, bid128_modf, 2, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- -(1-ulp) dec_test!(bid128_modf_050, bid128_modf, 2, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // -- -(Max) dec_test!(bid128_modf_051, bid128_modf, 3, 0x00000000000000000000000000000001u128, 0x30400000000000000000000000000000u128, 0x00000000000000000000000000000001u128, 0x00); // -- MinDen dec_test!(bid128_modf_052, bid128_modf, 3, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- MinNorm-ulp dec_test!(bid128_modf_053, bid128_modf, 3, 0x0000314DC6448D9338C15B0A00000000u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000000u128, 0x00); // -- MinNorm dec_test!(bid128_modf_054, bid128_modf, 3, 0x0000314DC6448D9338C15B0A00000001u128, 0x30400000000000000000000000000000u128, 0x0000314DC6448D9338C15B0A00000001u128, 0x00); // -- MinNorm+ulp dec_test!(bid128_modf_055, bid128_modf, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000000u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- 1-ulp dec_test!(bid128_modf_056, bid128_modf, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // -- Max dec_test!(bid128_modf_057, bid128_modf, 3, 0x80000000000000000000000000000001u128, 0xb0400000000000000000000000000000u128, 0x80000000000000000000000000000001u128, 0x00); // -- -(MinDen) dec_test!(bid128_modf_058, bid128_modf, 3, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B09FFFFFFFFu128, 0x00); // -- -(MinNorm-ulp) dec_test!(bid128_modf_059, bid128_modf, 3, 0x8000314DC6448D9338C15B0A00000000u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000000u128, 0x00); // -- -(MinNorm) dec_test!(bid128_modf_060, bid128_modf, 3, 0x8000314DC6448D9338C15B0A00000001u128, 0xb0400000000000000000000000000000u128, 0x8000314DC6448D9338C15B0A00000001u128, 0x00); // -- -(MinNorm+ulp) dec_test!(bid128_modf_061, bid128_modf, 3, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0xb0400000000000000000000000000000u128, 0xAFFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // -- -(1-ulp) dec_test!(bid128_modf_062, bid128_modf, 3, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // -- -(Max)