On Tuesday, 27 August 2019 at 16:45:53 UTC, Samir wrote:
I never understood why the intial value of floats, doubles and
reals was NaN.
That's for detecting uninitialised variables. If the result of a
calculation is NaN, it's likely, that you forgot to initialise
the variable.
On Tuesday, 27 August 2019 at 16:12:07 UTC, berni wrote:
What's your oppinion on this?
As someone relatively new to programming in general and to D in
particular, this behavior does, on the surface, seem
inconsistent. Good to see that a bug exists for this, per
ag0aep6g.
I never understoo
On 27.08.19 18:12, berni wrote:
import std.stdio;
void main()
{
real[int] a;
a[0] += 100;
writeln(a);
}
results (independed of the used compiler) in
[0:100]
I was a little bit surprised, because a[0] += 100 should be the same as
a[0] = a[0]+100, which leads to a range violatio