A strange div bug on Linux x86_64, (both dmd & ldc2): long -5000 / size_t 2 = 9223372036854773308

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Aug 17 11:24:08 UTC 2020


On 8/14/20 5:29 PM, Walter Bright wrote:
> On 8/14/2020 6:32 AM, Adam D. Ruppe wrote:
>> just I don't care, I want 16 bit operations here.
> 
> The design considerations are mutually incompatible:
> 
> 1. performance
> 2. aesthetics
> 3. requiring casts breaks generic code
> 4. should be able to index the entire address space
> 5. I need wraparound arithmetic
> 6. I need saturation arithmetic
> 7. must throw exception on overflow/underflow
> 8. must not throw exception on overflow/underflow
> 9. should work like 3rd grade arithmetic
> 10. type inference
> 11. should work like C
> 12. should work like C#
> 13. should work like Java
> 14. should work like Python

Heh, this looks like a list of things CheckedInt is supposed to help with.



More information about the Digitalmars-d mailing list