Wrong result with enum

Adam D Ruppe destructionator at gmail.com
Thu Nov 11 13:10:20 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


That's an `int` literal. Try

enum wLimit = 100_000L;

the L suffix makes a `long` literal.


More information about the Digitalmars-d-learn mailing list