diff --git a/dap-sdk/core/include/dap_math_ops.h b/dap-sdk/core/include/dap_math_ops.h index b1e45ab6ddccd98d646d8726536401a1f5b6579a..707f51b04ad304b4db060ac38a290298ef154217 100755 --- a/dap-sdk/core/include/dap_math_ops.h +++ b/dap-sdk/core/include/dap_math_ops.h @@ -1,6 +1,5 @@ #pragma once #include <stdint.h> - #include "dap_common.h" #include <boost/multiprecision/cpp_int.hpp> #include <stdint.h> @@ -93,7 +92,7 @@ static inline bool dap_unsign128_t_check_equal(unsign128_t a_128_bit, unsign128_ #ifdef DAP_GLOBAL_IS_INT128 return a_128_bit == b_128_bit; #else - return a_128_bit.lo==b_128_bit.lo && a_128_bit.hi==b_128_bit; + return a_128_bit.lo==b_128_bit.lo && a_128_bit.hi==b_128_bit.hi; #endif } diff --git a/dap-sdk/core/test/math/unit_test.cpp b/dap-sdk/core/test/math/unit_test.cpp index 6e7ebf4fd8583b359df3e00fd157a62920659fea..c37afbddb5e94e6f4367b2eb4c7a18ff1998f3e6 100644 --- a/dap-sdk/core/test/math/unit_test.cpp +++ b/dap-sdk/core/test/math/unit_test.cpp @@ -39,6 +39,9 @@ int main() std::ofstream sum_256_256_file; sum_256_256_file.open ("SUM_256_256.txt"); + std::ofstream prod_64_128_file; + prod_64_128_file.open ("PROD_64_128.txt"); + uint128_t hi_64{"0xffffffffffffffff0000000000000000"}; uint128_t lo_64{"0x0000000000000000ffffffffffffffff"}; @@ -137,7 +140,7 @@ int main() // // if(boost_dap_128_prod_comparison!=boost_test_64_128_prod){ // error_counter_prod+=1;} -// + if(verbose_output==1){ @@ -204,6 +207,22 @@ int main() sum_256_256_file << (boost_dap_256_comparison)<< std::endl;} + +// if(boost_dap_256_comparison!=boost_test_256_sum){ +// +// prod_64_128_file << "boost_dap_128_prod_comparison"<< std::endl; +// +// prod_64_128_file << (boost_dap_128_prod_comparison)<< std::endl; +// +// prod_64_128_file << "boost_test_64_128_prod"<< std::endl; +// +// prod_64_128_file << (boost_test_64_128_prod)<< std::endl; +// +//} +// + + + @@ -221,10 +240,10 @@ int main() std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;} - - if(error_counter_prod==0){ - - std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;} +// +// if(error_counter_prod==0){ +// +// std::cout<< "SUM_256_256 returns identical results to boost:: 256 bit addition"<< std::endl;} return 0;