+1

div: integer division

D CBN 1 week ago in IQANdesign updated 3 days ago 6

Image 4776

Image 4777

Image 4778

Image 4780

Image 4781

Expected -2 result for (-16.80 div 10) operation;

Expected -1 result for (-13.60 div 10) operation;

With integer division the fractional part is discarded, not rounded.

This is for the result out from the function, the input is rounded.

so 16,8 would be rounded to 17 and so on.

So for (-16.80 div 10) you would expect to see -1.

But as for -13,6 you would want to see -1 also and the 6,15 you would see 0 on also.


Is something else happening in this code that can mess it up?

What version of IQAN are you using?

Could you share the entire code?

I tested the div functionality myself and got these results.

Image 4784

Image 4787

in fact, if input is integer, works normally;
But if input is not integer, as in example, 9.7 div 10 equals to 1, expected 0

Image 4788

in this example expected -3 when -39.7 / 10 equals to -3.97, then keep entire...

my similar code when i wrote the bug request

Image 4790

incoherent result, perhaps new bug as following

Image 4791

Image 4792

<This> seems be the final result ? not sequenced steps ?

Hello.

Now i see what is going on here.

"This" is actually the final result of the previous cycle.

So this would explain what is going on.

The "this" parameter can not be used in sequences like you are trying.

I would suggest just using an internal parameter in your code instead.

Then you could use sequenced steps like you are trying here.

For DIV bug, and ROUND bug,
Shall i write for each a new page forum ?

Image 4795