On 12/22/21 11:49 PM, Andy Shevchenko wrote:
On Wed, Dec 22, 2021 at 5:59 PM Muhammad Usama AnjumNo, it correct already. In this case, rem is being typecasted to s64 and
<usama.anjum@xxxxxxxxxxxxx> wrote:
Two 32-bit values are being evaluated using 32-bit arithmetic and then...
passed to s64 type. It is wrong. Expression should be evaluated using
64-bit arithmetic and then passed.
dac->ch_data[ch].scale_dec = DIV_ROUND_CLOSEST((s64)rem * 1000000,Shouldn't the above be fixed as well? Has anybody tried to compile on
65536);
32-bit arch this?
then multiplied with a 32-bit number, 1000000. Thus 64-bit arithmetic is
being performed here.