Always false float comparisons
Ola Fosheim Grøstad via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 18 04:38:39 PDT 2016
On Wednesday, 18 May 2016 at 11:12:16 UTC, Joseph Rushton
Wakeling wrote:
> I'm not sure that the `const float` vs `float` is the
> difference per se. The difference is that in the examples
> you've given, the `const float` is being determined (and used)
> at compile time.
They both have to be determined at compile time... as there is
only a cast involved. The real issue is that the const float
binding is treated textually.
> But a `const float` won't _always_ be determined or used at
> compile time, depending on the context and manner in which the
> value is set.
Which makes the problem worse, not better.
More information about the Digitalmars-d
mailing list