Marco Leise:
That's why Pascal uses another set of operators for integer divisions,
namely 'div' and 'mod', so you can never get into that situation. The
above code would have worked and in case step was an integer, the compiler
would have complained about not using 'div'. I doubt that
Am 09.07.2011, 00:45 Uhr, schrieb Andrej Mitrovic
andrej.mitrov...@gmail.com:
This is just an observation, not a question or anything.
void main()
{
enum width = 100;
double step = 1 / width;
writeln(step); // 0
}
I've just had this bug in my code. I forgot to make either
Andrej Mitrovic wrote:
This is just an observation, not a question or anything.
void main()
{
enum width = 100;
double step = 1 / width;
writeln(step); // 0
}
I've just had this bug in my code. I forgot to make either width or 1
a floating-point type. IOW, I didn't do this:
void
Steven Schveighoffer Wrote:
On Tue, 12 Jul 2011 11:07:57 -0400, Kagamin s...@here.lot wrote:
Steven Schveighoffer Wrote:
Yes, but this is getting into territory where the false positive rate
might get high.
I bet it will be difficult to find a real-world example of this false
On Mon, 11 Jul 2011 16:46:07 -0400, Nick Sabalausky a@a.a wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
Hm... I didn't know about that switch, I thought warnings were enabled
with -w and that made them errors.
I suppose you could stick this in there.
-wi: Enable
Steven Schveighoffer Wrote:
Yes, but this is getting into territory where the false positive rate
might get high.
I bet it will be difficult to find a real-world example of this false positive.
On Tue, 12 Jul 2011 11:07:57 -0400, Kagamin s...@here.lot wrote:
Steven Schveighoffer Wrote:
Yes, but this is getting into territory where the false positive rate
might get high.
I bet it will be difficult to find a real-world example of this false
positive.
It depends on how the
On Sat, 09 Jul 2011 13:28:25 -0400, Nick Sabalausky a@a.a wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vybq4xkkeav7ka@localhost.localdomain...
On Fri, 08 Jul 2011 18:45:58 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
This is just an observation, not a
On Sat, 09 Jul 2011 07:38:39 -0400, Daniel Murphy
yebbl...@nospamgmail.com wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vybo0hv1eav7ka@localhost.localdomain...
1. is a horrible legacy thing, and should be removed.
-Steve
This I hate, but I'd hate to lose 1.f and
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vygk71eweav7ka@localhost.localdomain...
What's wrong with 1.0f and 1.0L ?
-Steve
It's one character longer!
Mostly it's just a habit I've gotten into. I'd likely be able to get used
to writing the zero fairly easily.
On Mon, 11 Jul 2011 10:45:16 -0400, Daniel Murphy
yebbl...@nospamgmail.com wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vygk71eweav7ka@localhost.localdomain...
What's wrong with 1.0f and 1.0L ?
-Steve
It's one character longer!
1f is one character shorter :P
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vygm6auqeav7ka@localhost.localdomain...
1f is one character shorter :P (BTW, not sure the grammar currently
supports this one, even though it compiles. I think:
Integer FloatSuffix
should be added.
I admit, there is no
On Mon, 11 Jul 2011 11:22:40 -0400, Daniel Murphy
yebbl...@nospamgmail.com wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vygm6auqeav7ka@localhost.localdomain...
1f is one character shorter :P (BTW, not sure the grammar currently
supports this one, even though it
On Monday 11 July 2011 08:17:50 Steven Schveighoffer wrote:
On Sat, 09 Jul 2011 13:28:25 -0400, Nick Sabalausky a@a.a wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vybq4xkkeav7ka@localhost.localdomain...
On Fri, 08 Jul 2011 18:45:58 -0400, Andrej Mitrovic
On Mon, 11 Jul 2011 11:45:47 -0400, Jonathan M Davis jmdavisp...@gmx.com
wrote:
On Monday 11 July 2011 08:17:50 Steven Schveighoffer wrote:
Hm... I didn't know about that switch, I thought warnings were enabled
with -w and that made them errors.
I suppose you could stick this in there.
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vyge30ogeav7ka@localhost.localdomain...
On Sat, 09 Jul 2011 13:28:25 -0400, Nick Sabalausky a@a.a wrote:
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vybq4xkkeav7ka@localhost.localdomain...
On Fri, 08 Jul
On 2011-07-09 01:03, Steven Schveighoffer wrote:
On Fri, 08 Jul 2011 18:47:55 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
On 7/9/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
double step = 1 / width; // or .1
Woops that should have been `1.`. See, another bug right
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vybo0hv1eav7ka@localhost.localdomain...
1. is a horrible legacy thing, and should be removed.
-Steve
This I hate, but I'd hate to lose 1.f and 1.L
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vybq4xkkeav7ka@localhost.localdomain...
On Fri, 08 Jul 2011 18:45:58 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
This is just an observation, not a question or anything.
void main()
{
enum width = 100;
This is just an observation, not a question or anything.
void main()
{
enum width = 100;
double step = 1 / width;
writeln(step); // 0
}
I've just had this bug in my code. I forgot to make either width or 1
a floating-point type. IOW, I didn't do this:
void main()
{
enum width
On 7/9/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
double step = 1 / width; // or .1
Woops that should have been `1.`. See, another bug right there!
On Fri, 08 Jul 2011 18:47:55 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
On 7/9/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
double step = 1 / width; // or .1
Woops that should have been `1.`. See, another bug right there!
1.0
1. is a horrible legacy thing,
On 7/9/11, Steven Schveighoffer schvei...@yahoo.com wrote:
On Fri, 08 Jul 2011 18:47:55 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
On 7/9/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
double step = 1 / width; // or .1
Woops that should have been `1.`. See,
Andrej Mitrovic:
enum width = 100;
double step = 1 / width;
...
This seems like a very easy mistake to make.
Right, it was present even in Python 2.x:
http://ideone.com/BEZqq
The bug you have found is common enough to deserve a so fundamental change in
Python, they have improved it
On Fri, 08 Jul 2011 18:45:58 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
This is just an observation, not a question or anything.
void main()
{
enum width = 100;
double step = 1 / width;
writeln(step); // 0
}
I've just had this bug in my code. I forgot to make
25 matches
Mail list logo