On Friday, 19 August 2016 at 15:01:58 UTC, Marco Leise wrote:
Am Fri, 19 Aug 2016 13:36:05 +0000
schrieb Adam D. Ruppe <destructiona...@gmail.com>:
On Friday, 19 August 2016 at 08:31:39 UTC, Marco Leise wrote:
> If we hypothetically switched to a ubyte+ubyte=ubyte
> semantic, then code like this breaks silently:
However, if it took the entire statement into account, it
could handle that... by my rule, it would see there's a float
in there and thus automatically cast a and b to float before
doing anything.
Float math is slow compared to integer math and precision loss
occurs when this rule is also applied to (u)int and (u)long
with only the deprecated (as per amd64 spec) real type being
large enough for 64-bit integers.
Try multiplications and divisions.