|
-
December 13th, 2006, 05:01 PM
#4
Re: another float/int/for question
 Originally Posted by lab1
Hello I have a loop like this:
int j;
for(float i = 0.0f, j = 0; i <= 1.0f; i=i+(1.0f/CDF_RESOLUTION, j++))
intervalEdges.push_back(j);
For some reason when I look at "j" value it is represented as a floating point number.
Any idea why? Is this the best way to try to do something like this??
Thanks!
This is not part of your subject line, but there are far more worse issues with this code that were discussed here already.
http://www.codeguru.com/forum/showthread.php?t=408602
https://www.securecoding.cert.org/co...+loop+counters
http://www.math.ucsd.edu/~sbuss/Cou...atingperils.pdf
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|