jicman wrote:
Greetings!
I need your help, if so at all possible...
I just lost lots of code changes because a computer lock down, but I have a
good .exe file with .obj and also .exe files. Is there a possibility to grab
the code from those files? Or, is there any way that I can
On Wed, 04 Nov 2009 06:14:36 -0500, Joel Christensen joel...@gmail.com
wrote:
Input:
import std.stdio;
void main() {
float f=0.01;
writefln(%0.2f-%d,f,cast(int)(f*100f));
}
Output:
0.01-0
Comment:
What!?
hehe. .01 is not exactly represented by float, because it's stored
Steven Schveighoffer schvei...@yahoo.com wrote:
On Wed, 04 Nov 2009 06:14:36 -0500, Joel Christensen joel...@gmail.com
wrote:
Input:
import std.stdio;
void main() {
float f=0.01;
writefln(%0.2f-%d,f,cast(int)(f*100f));
}
Output:
0.01-0
Comment:
What!?
hehe. .01 is not
Hello rmcguire,
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
writefln(%0.2f-%d,f,cast(int)(f*100f));
writefln(%0.2f-%d,f,cast(int)(.01*100f));
writefln(%0.2f-%f,f,(f*100f));
}
results in:
0.01-0
0.01-1
0.01-1.00
I would say something is dodgy.
Michal Minich wrote:
Hello rmcguire,
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
writefln(%0.2f-%d,f,cast(int)(f*100f));
writefln(%0.2f-%d,f,cast(int)(.01*100f));
writefln(%0.2f-%f,f,(f*100f));
}
results in:
0.01-0
0.01-1
0.01-1.00
I would say
Lars T. Kyllingstad wrote:
Michal Minich wrote:
Hello rmcguire,
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
writefln(%0.2f-%d,f,cast(int)(f*100f));
writefln(%0.2f-%d,f,cast(int)(.01*100f));
writefln(%0.2f-%f,f,(f*100f));
}
results in:
0.01-0
0.01-1
Charles Hixson wrote:
Lars T. Kyllingstad wrote:
Michal Minich wrote:
Hello rmcguire,
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
writefln(%0.2f-%d,f,cast(int)(f*100f));
writefln(%0.2f-%d,f,cast(int)(.01*100f));
writefln(%0.2f-%f,f,(f*100f));
}
Ok, I messed up my previous comment while moving rmcguire's lines around.
Trying again... Also, I am not sure about the last bit now. :)
rmcguire Wrote:
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
Just an information: 0.01 is double,
With respect to the dmd -release compiler switch,
are assert statements meant to be compiled in release code?
Whilst the D1 spec says The compiler may optionally not evaluate assert
expressions at all.,
my intuition suggests that asserts would/should be evaluated (i.e. compiled in)
when using
Hello Justin,
With respect to the dmd -release compiler switch,
are assert statements meant to be compiled in release code?
Whilst the D1 spec says The compiler may optionally not evaluate
assert expressions at all.,
my intuition suggests that asserts would/should be evaluated (i.e.
compiled
HI,
I would like to use some pbobos string based functions within an DLL.
Unfortunately all I can do is to pass char* parameters from the callee
side.
Now I want to use f.i. std.regex
export extern(windows) char* xxx()
//Heck were is Jarret when I need him most ?
D2,beside
Björn
On 05/11/2009 00:11, BLS wrote:
char* xxx()
better
char* xxx(char* a, char* b)
{
string A =
}
yep, mean it...
has somebody done it before...to me it seems to be not as trivial as it
looks on the very first view. (speed matters)
BLS wrote:
yep, mean it...
has somebody done it before...to me it seems to be not as trivial as it
looks on the very first view. (speed matters)
Did one in C once for an editor (of course). Does that count? I might be
able to find the code. It might not be pretty I can't remember.
On 05/11/2009 01:04, Spacen Jasset wrote:
BLS wrote:
yep, mean it...
has somebody done it before...to me it seems to be not as trivial as
it looks on the very first view. (speed matters)
Did one in C once for an editor (of course). Does that count? I might be
able to find the code. It might
To be safe, whenever converting to int, always add a small epsilon. I
think you can use float.epsilon, but I don't have any experience with
whether that is always reasonable.
-Steve
Thanks every one for the replies.
I still have problems. How do I use epsilon? 'real' helps in my example
16 matches
Mail list logo