[OT] The Usual Arithmetic Confusions

Walter Bright newshound2 at digitalmars.com
Fri Feb 4 23:25:14 UTC 2022


On 2/4/2022 6:12 AM, Adam D Ruppe wrote:
> I'd allow that. The input is a and b, they're both short, so let the output 
> truncate back to short implicitly too. Just like with int, there's some 
> understanding that yes, there is a high word produced by the multiply, but it 
> might not fit and I don't need the compiler nagging me like I'm some kind of 
> ignoramus.

As I observed before, there is no solution. Just different problems. It's best 
to stick with a scheme that has well-understood issues and works best with the 
common CPU architectures.


More information about the Digitalmars-d mailing list