float in loop
how come this only prints up to .9, excluding 1?
[Error: Irreparable invalid markup ('<pre [...] 20px;>') in entry. Owner must fix manually. Raw contents below.]
how come this only prints up to .9, excluding 1?
<pre style=margin:0; padding-left: 20px;>#include <iostream>
using std::cout;
using std::endl;
int main() {
for(float i=.1; i<=1; i+=.1) {
cout << i << endl;
}
return 0;
}</pre>
<pre style=margin:0; padding-left: 20px;>#include <iostream>
using std::cout;
using std::endl;
int main() {
for(float i=.1; i<=1; i+=.1) {
cout << i << endl;
}
return 0;
}</pre>
