Re: fast floor

2013-10-13 Thread ponce
On Thursday, 10 October 2013 at 22:27:14 UTC, Spacen Jasset wrote: Hello, I am after a fast floor function; In fact a fast truncation and conversion to integer. I see that std.math takes a real, and that std.c.math takes a double. Is there a quicker function, and what might cast(int)1.5f do?

Re: fast floor

2013-10-13 Thread Joseph Rushton Wakeling
On Friday, 11 October 2013 at 20:31:50 UTC, Spacen Jasset wrote: I will have to learn about what "to" does exactly. It wasn't around when I looked at D x years ago. http://dlang.org/phobos/std_conv.html#.to Its principal benefit is that it can do overflow checks, so it's worth using unless th

Re: fast floor

2013-10-11 Thread Spacen Jasset
On 11/10/2013 07:25, monarch_dodra wrote:> On Thursday, 10 October 2013 at 22:27:14 UTC, Spacen Jasset wrote: >> Hello, >> >> I am after a fast floor function; In fact a fast truncation and >> conversion to integer. I see that std.math takes a real, and that >> std.c.math takes a double. >> >> Is

Re: fast floor

2013-10-11 Thread Sönke Ludwig
Am 11.10.2013 00:27, schrieb Spacen Jasset: Hello, I am after a fast floor function; In fact a fast truncation and conversion to integer. I see that std.math takes a real, and that std.c.math takes a double. Is there a quicker function, and what might cast(int)1.5f do? Regards, Spacen. For

Re: fast floor

2013-10-10 Thread monarch_dodra
On Thursday, 10 October 2013 at 22:27:14 UTC, Spacen Jasset wrote: Hello, I am after a fast floor function; In fact a fast truncation and conversion to integer. I see that std.math takes a real, and that std.c.math takes a double. Is there a quicker function, and what might cast(int)1.5f do?

Re: fast floor

2013-10-10 Thread Joseph Rushton Wakeling
On 11/10/13 00:27, Spacen Jasset wrote: I am after a fast floor function; In fact a fast truncation and conversion to integer. I see that std.math takes a real, and that std.c.math takes a double. Is there a quicker function, and what might cast(int)1.5f do? What's wrong with to!int(floor