Re: while( *it == value && it != v.end() )

2007-02-14 Thread mathieu
On Feb 13, 10:07 pm, Paul Pluzhnikov <[EMAIL PROTECTED]> wrote: > "mathieu" <[EMAIL PROTECTED]> writes: > > Just to be sure I am double-checking here. > > Is there a way to make gcc produce a warning when a code is > > dereferencing an end iterator ? Or does this involve too much static > > ana

Re: while( *it == value && it != v.end() )

2007-02-13 Thread Paul Pluzhnikov
"mathieu" <[EMAIL PROTECTED]> writes: > Just to be sure I am double-checking here. > Is there a way to make gcc produce a warning when a code is > dereferencing an end iterator ? Or does this involve too much static > analysis ? The latter. You can however ask newer versions of g++ to catch

Re: While

2006-03-27 Thread Paul Pluzhnikov
Wilhelm Korrengk <[EMAIL PROTECTED]> writes: >> while (1.e-10 < i) { ... } > Unfortunately 1.e-10 is not equal to 0; I think you may be missing the point: 'i' will *never* be equal to 0. You have to define appropriate epsilon (1.e-10 was just an example). > That`s why i can "increment" with d

Re: While

2006-03-27 Thread Wilhelm Korrengk
Thank you, I did not know that float can be strange even if they are small... > while (1.e-10 < i) { ... } Unfortunately 1.e-10 is not equal to 0; That`s why i can "increment" with d += 0.1 up to 0 even if -0.1 is the point I wanted to stop. while still looks ugly Thank you Wilhelm Korrengk _

Re: While

2006-03-26 Thread Paul Pluzhnikov
Wilhelm Korrengk <[EMAIL PROTECTED]> writes: > even if I`m not THE Pro coding c++ > I thought I`m already better not to ask the following: ... code expecting double equality ... > It does not matter whether i is positive or negative while will > stop when i is 0. > > But is doesn`t. You need t