On Saturday, 19 September 2020 at 21:53:34 UTC, mw wrote:
On Thursday, 20 June 2019 at 07:57:25 UTC, KnightMare wrote:
imo NaN is useless, weird and unusual coz integrals and
pointers are "all bits zeroes" but float and chars are "all
bits ones". WTF? its strange that bool.init is false in
On Thursday, 20 June 2019 at 07:57:25 UTC, KnightMare wrote:
On Thursday, 20 June 2019 at 01:32:04 UTC, matheus wrote:
import std.stdio;
import std.array;
void main(){
auto s = uninitializedArray!(float[])(100);
s[] = 0.0f;
writeln(s[0]);
}
Even with this, user has to write two
Thanks Matheus, thats what i needed.
I added a PR to mention this function in the language
documentation about arrays.
On Thursday, 20 June 2019 at 01:32:04 UTC, matheus wrote:
import std.stdio;
import std.array;
void main(){
auto s = uninitializedArray!(float[])(100);
s[] = 0.0f;
writeln(s[0]);
}
another version:
auto arr = new double[ 10 ];
writeln( arr[5] ); // NaN
arr.length += 10;
writeln(
On Thursday, 20 June 2019 at 01:06:09 UTC, Alex wrote:
Is there a way of creating and initialising a dynamic array ?
for example I am doing this:
auto arr = new float[];
arr[] = 0.0f;
Profiling indicates that the compiler (gdc) is spending
significant time memsetting the whole array to