Wrong result with enum

Stanislav Blinov stanislav.blinov at gmail.com
Thu Nov 11 06:34:16 UTC 2021


On Thursday, 11 November 2021 at 05:37:05 UTC, Salih Dincer wrote:
> is this a issue, do you need to case?
>
> ```d
> enum tLimit = 10_000;  // (1) true result
> enum wLimit = 100_000; // (2) wrong result
> ```

https://dlang.org/spec/enum.html#named_enums

Unless explicitly set, default type is int. 10000100000 is 
greater than int.max.


More information about the Digitalmars-d-learn mailing list