/* ---------------------------------------------------------------------------------------------------*/ /* 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_fmod_001, bid128_fmod, 0, 0x00000000000000000000000000000001u128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=MinDen,y=Max dec_test!(bid128_fmod_002, bid128_fmod, 0, 0x0001ed09bead87c0378d8e64ffffffffu128, 0x303e000000000000000000000000000au128, 0x00000000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_003, bid128_fmod, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=1 dec_test!(bid128_fmod_004, bid128_fmod, 0, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_005, bid128_fmod, 0, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFC0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=1,y=1-ulp dec_test!(bid128_fmod_006, bid128_fmod, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00000000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=MinDen dec_test!(bid128_fmod_007, bid128_fmod, 0, 0x6003b75d7734cd9e1234567890123456u128, 0x303e000000000000000000000000000au128, 0x000e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_008, bid128_fmod, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0x303e000000000000000000000000000au128, 0x276e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_009, bid128_fmod, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0x69dbb75d7734cd9e1234567890123456u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_010, bid128_fmod, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0x7e000000000110000000000000000000u128, 0x7c000000000110000000000000000000u128, 0x01); dec_test!(bid128_fmod_011, bid128_fmod, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0xe003b75d7734cd9e1234567890123456u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_012, bid128_fmod, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0xf8000000000000000000000000001100u128, 0x276e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_013, bid128_fmod, 0, 0x69dbb75d7734cd9e1234567890123456u128, 0xfc000000000000000000011000000000u128, 0xfc000000000000000000011000000000u128, 0x00); dec_test!(bid128_fmod_014, bid128_fmod, 0, 0x78000000000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_015, bid128_fmod, 0, 0x78000000000000000000000000000100u128, 0x69dbb75d7734cd9e1234567890123456u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_016, bid128_fmod, 0, 0x78000000000000000000000000000100u128, 0x7e000000000110000000000000000000u128, 0x7c000000000110000000000000000000u128, 0x01); dec_test!(bid128_fmod_017, bid128_fmod, 0, 0x78000000000000000000000000000100u128, 0xe003b75d7734cd9e1234567890123456u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_018, bid128_fmod, 0, 0x78000000000000000000000000000100u128, 0xf8000000000000000000000000001100u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_019, bid128_fmod, 0, 0x78000000000000000000000000000100u128, 0xfc000000000000000000011000000000u128, 0xfc000000000000000000011000000000u128, 0x00); dec_test!(bid128_fmod_020, bid128_fmod, 0, 0x78000001000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_021, bid128_fmod, 0, 0x7c000000000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_022, bid128_fmod, 0, 0x7c000000000000000000010000000000u128, 0x69dbb75d7734cd9e1234567890123456u128, 0x7c000000000000000000010000000000u128, 0x00); dec_test!(bid128_fmod_023, bid128_fmod, 0, 0x7c000000000000000000010000000000u128, 0x7e000000000110000000000000000000u128, 0x7c000000000000000000010000000000u128, 0x01); dec_test!(bid128_fmod_024, bid128_fmod, 0, 0x7c000000000000000000010000000000u128, 0xe003b75d7734cd9e1234567890123456u128, 0x7c000000000000000000010000000000u128, 0x00); dec_test!(bid128_fmod_025, bid128_fmod, 0, 0x7c000000000000000000010000000000u128, 0xf8000000000000000000000000001100u128, 0x7c000000000000000000010000000000u128, 0x00); dec_test!(bid128_fmod_026, bid128_fmod, 0, 0x7c000000000000000000010000000000u128, 0xfc000000000000000000011000000000u128, 0x7c000000000000000000010000000000u128, 0x00); dec_test!(bid128_fmod_027, bid128_fmod, 0, 0x7c000001000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000001000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_028, bid128_fmod, 0, 0x7cff3fffffffefffffffffffffffffffu128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_029, bid128_fmod, 0, 0x7e000000000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_030, bid128_fmod, 0, 0x7e003fffffffefffffffffffffffffffu128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_031, bid128_fmod, 0, 0x7ef00000000000000000000000000001u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000001u128, 0x01); dec_test!(bid128_fmod_032, bid128_fmod, 0, 0xe003b75d7734cd9e1234567890123456u128, 0x303e000000000000000000000000000au128, 0x800e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_033, bid128_fmod, 0, 0xe003b75d7734cd9e1234567890123456u128, 0x69dbb75d7734cd9e1234567890123456u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_034, bid128_fmod, 0, 0xe003b75d7734cd9e1234567890123456u128, 0x7e000000000110000000000000000000u128, 0x7c000000000110000000000000000000u128, 0x01); dec_test!(bid128_fmod_035, bid128_fmod, 0, 0xe003b75d7734cd9e1234567890123456u128, 0xe003b75d7734cd9e1234567890123456u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_036, bid128_fmod, 0, 0xe003b75d7734cd9e1234567890123456u128, 0xf8000000000000000000000000001100u128, 0x800e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_037, bid128_fmod, 0, 0xe003b75d7734cd9e1234567890123456u128, 0xfc000000000000000000011000000000u128, 0xfc000000000000000000011000000000u128, 0x00); dec_test!(bid128_fmod_038, bid128_fmod, 0, 0xe9dbb75d7734cd9e1234567890123456u128, 0x303e000000000000000000000000000au128, 0xa76e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_039, bid128_fmod, 0, 0xf8000000000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_040, bid128_fmod, 0, 0xf8000001000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_041, bid128_fmod, 0, 0xfc000000000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0xfc000000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_042, bid128_fmod, 0, 0xfc000001000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0xfc000001000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_043, bid128_fmod, 0, 0xfe000000000000000000000000000000u128, 0x303e000000000000000000000000000au128, 0xfc000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_044, bid128_fmod, 0, 0xfe000000000100000000000000000000u128, 0x69dbb75d7734cd9e1234567890123456u128, 0xfc000000000100000000000000000000u128, 0x01); dec_test!(bid128_fmod_045, bid128_fmod, 0, 0xfe000000000100000000000000000000u128, 0x7e000000000110000000000000000000u128, 0xfc000000000100000000000000000000u128, 0x01); dec_test!(bid128_fmod_046, bid128_fmod, 0, 0xfe000000000100000000000000000000u128, 0xe003b75d7734cd9e1234567890123456u128, 0xfc000000000100000000000000000000u128, 0x01); dec_test!(bid128_fmod_047, bid128_fmod, 0, 0xfe000000000100000000000000000000u128, 0xf8000000000000000000000000001100u128, 0xfc000000000100000000000000000000u128, 0x01); dec_test!(bid128_fmod_048, bid128_fmod, 0, 0xfe000000000100000000000000000000u128, 0xfc000000000000000000011000000000u128, 0xfc000000000100000000000000000000u128, 0x01); dec_test!(bid128_fmod_049, bid128_fmod, 0, 0xfef00000000000000000000000000001u128, 0x303e000000000000000000000000000au128, 0xfc000000000000000000000000000001u128, 0x01); dec_test!(bid128_fmod_050, bid128_fmod, 1, 0x00000000000000000000000000000001u128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=MinDen,y=Max dec_test!(bid128_fmod_051, bid128_fmod, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=1 dec_test!(bid128_fmod_052, bid128_fmod, 1, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_053, bid128_fmod, 1, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFC0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=1,y=1-ulp dec_test!(bid128_fmod_054, bid128_fmod, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00000000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=MinDen dec_test!(bid128_fmod_055, bid128_fmod, 2, 0x00000000000000000000000000000001u128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=MinDen,y=Max dec_test!(bid128_fmod_056, bid128_fmod, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=1 dec_test!(bid128_fmod_057, bid128_fmod, 2, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_058, bid128_fmod, 2, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFC0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=1,y=1-ulp dec_test!(bid128_fmod_059, bid128_fmod, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00000000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=MinDen dec_test!(bid128_fmod_060, bid128_fmod, 3, 0x00000000000000000000000000000001u128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=MinDen,y=Max dec_test!(bid128_fmod_061, bid128_fmod, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=1 dec_test!(bid128_fmod_062, bid128_fmod, 3, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_063, bid128_fmod, 3, 0x30400000000000000000000000000001u128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFC0000000000000000000000000001u128, 0x00); // ulp=0.0000000000 -- x=1,y=1-ulp dec_test!(bid128_fmod_064, bid128_fmod, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x00000000000000000000000000000001u128, 0x00000000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=MinDen dec_test!(bid128_fmod_065, bid128_fmod, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2ffc0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_066, bid128_fmod, 0, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=-Max dec_test!(bid128_fmod_067, bid128_fmod, 0, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_068, bid128_fmod, 0, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_069, bid128_fmod, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2ffc0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_070, bid128_fmod, 1, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=-Max dec_test!(bid128_fmod_071, bid128_fmod, 1, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_072, bid128_fmod, 1, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_073, bid128_fmod, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2ffc0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_074, bid128_fmod, 2, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=-Max dec_test!(bid128_fmod_075, bid128_fmod, 2, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_076, bid128_fmod, 2, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_077, bid128_fmod, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x2FFDED09BEAD87C0378D8E63FFFFFFFFu128, 0x2ffc0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=1-ulp,y=Max dec_test!(bid128_fmod_078, bid128_fmod, 3, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5ffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=Max,y=-Max dec_test!(bid128_fmod_079, bid128_fmod, 3, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_080, bid128_fmod, 3, 0xDFFFED09BEAD87C0378D8E63FFFFFFFFu128, 0x5FFFED09BEAD87C0378D8E63FFFFFFFFu128, 0xdffe0000000000000000000000000000u128, 0x00); // ulp=0.0000000000 -- x=-Max,y=Max dec_test!(bid128_fmod_081, bid128_fmod, 0, 0x32260a2e154fd95c7f3324d2fbb1c1e9u128, 0x000070001121000000000002a0008100u128, 0x00006ef28c8d9c7393a2ec31fb2ff700u128, 0x00); dec_test!(bid128_fmod_082, bid128_fmod, 0, 0x2055b0887299e1a08008121850010620u128, 0xfaecfbd19bf36d670080000000100000u128, 0x2055b0887299e1a08008121850010620u128, 0x00); dec_test!(bid128_fmod_083, bid128_fmod, 0, 0x76549191fdfa47bd011f1b19acc37882u128, 0x8d9edf0c69f81792ad96874e67e37748u128, 0x0d9e0000000000000000000000000000u128, 0x00); dec_test!(bid128_fmod_084, bid128_fmod, 0, 0xdee6c6fde8d172a3915ea70d5bd53f75u128, 0x6fef7f33f6ffd7c798db992770314564u128, 0x7c000000000000000000000000000000u128, 0x01); dec_test!(bid128_fmod_085, bid128_fmod, 0, 0x88894084788239081000a020c2116648u128, 0x889bbd12214552f4ffffffbfffffff7fu128, 0x88894084788239081000a020c2116648u128, 0x00);