"I have had a surprise making with this simple multiplication:"
Nothing in that result is surprising.
"The result must be 8.2e-6!!!"
In fact the result cannot be exactly 8.2e-6, simply because there is no such value in (double) binary floating point. The closest value is actually (here I used James Tursa's excellent FEX submission num2strexact):
>> N = 8.2e-6;
The closest representable value on the other side is:
So, it is clear that your expected value cannot be exactly represented using double floating point.
Lets now have a look at the input value which also cannot be exactly representated by double floating point numbers:
and the actual product of those two values:
So far nothing unexpected, in fact I'm impressed that the multiplication gave the nearest representable value.
"I have the correct result doing before "format short":"
It is not more nor less correct than the long format, just exactly the same value stored in memory displayed to a different number of significant digits. Changing the displayed decimal precision makes absolutely no difference the the value stored in memory, nor does it make any difference to the binary precision of that value stored in memory.
"The answers based in the binary nature of the machine and rounding, doesn't convince me in this case."
- given that one of your input values and also the expected result cannot be exactly represented by double floating point numbers, how do you expect them to be exactly represented by double floating point numbers?
- If this is not a behavior that you think is due to the nature of binary floating point numbers, then what are the obeservable behaviors of binary floating point numbers? Should they behave like the numbers you learned about at school?
"Is this a bug???"