For the following program:
#include
#include
using namespace std;
int main()
{
for (float a = 1.0; a < 10; a++)
Floats only have so much precision (23 bits worth to be precise). If you REALLY want to see "0.333333333333333333333333333333" output, you could create a custom "Fraction" class which stores the numerator and denominator separately. Then you could calculate the digit at any given point with complete accuracy.