Re: Help optimizing code?

2018-01-01 Thread Muld via Digitalmars-d-learn
On Monday, 1 January 2018 at 16:47:40 UTC, Adam D. Ruppe wrote: On Monday, 1 January 2018 at 16:13:37 UTC, Muld wrote: If you use .ptr then you get zero detection, even in debug builds. It is limited to the one expression where you wrote it, instead of on the ENTIRE program like the build

Re: Help optimizing code?

2018-01-01 Thread Muld via Digitalmars-d-learn
On Monday, 1 January 2018 at 15:54:33 UTC, Adam D. Ruppe wrote: On Monday, 1 January 2018 at 15:29:28 UTC, user1234 wrote: dmd mandelbrot.d -O -release -inline -boundscheck=off -O and -inline are OK, but -release and -boundscheck are harmful and shouldn't be used. Yeah, you can squeeze a

Re: Slices and Dynamic Arrays

2017-12-29 Thread Muld via Digitalmars-d-learn
On Friday, 29 December 2017 at 22:32:01 UTC, Tony wrote: In DLang Tour:Arrays https://tour.dlang.org/tour/en/basics/arrays there is: --- int size = 8; // run-time variable int[] arr = new int[size]; The type of arr is int[], which is a slice.

Re: Compiler gets confused with ambiguity when `int` matches both `real` and `float`.

2017-12-23 Thread Muld via Digitalmars-d-learn
On Saturday, 23 December 2017 at 07:25:34 UTC, IM wrote: The following expression: import std.math : sqrt; sqrt(400); produces the following compiler error: std.math.sqrt called with argument types (int) matches both: /usr/include/dmd/phobos/std/math.d(1592,7): std.math.sqrt(float x)