[OT] The Usual Arithmetic Confusions

Adam Ruppe destructionator at gmail.com
Fri Feb 4 23:36:11 UTC 2022


On Friday, 4 February 2022 at 23:25:14 UTC, Walter Bright wrote:
> 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.

I don't think you understand my proposal, which is closer to C's 
existing rules than D is now.


More information about the Digitalmars-d mailing list