You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ac_ieee32_float32::add returns a result with wrong sign for some combinations of operand values if AC_RND_INF rounding mode is used. The following program
#include"ac_std_float.h"
#include<cstdint>
#include<cstring>
#include<iomanip>
#include<iostream>intmain() {
std::uint32_t au = 0x380470edu;
std::uint32_t bu = 0x447fffffu;
float af, bf;
std::memcpy(&af, &au, sizeof af);
std::memcpy(&bf, &bu, sizeof bf);
ac_ieee_float32 a = af;
ac_ieee_float32 b = bf;
ac_ieee_float32 c = a.add<AC_RND_INF, false>(b);
std::cout << std::setprecision(9) << a << " + " << b << " = " << c << std::endl;
}
ac_ieee32_float32::add
returns a result with wrong sign for some combinations of operand values ifAC_RND_INF
rounding mode is used. The following programprints
which is obviously wrong. It seems that the code that determines sign of result has bug.
Compilers used: MinGW-w64 GCC 8.0.1 x86_64 and MSVC 2019 (v16.7.2).
The text was updated successfully, but these errors were encountered: