#!/usr/bin/perl -w
use strict;

# How accurately are fractions stored in standard floating point.
# Let's see...

print " Time to look at 1./3. in decimal.  \n";
print " (Try digits > 20 or so for a really good time.)\n\n";
while (1) {
  print " How many digits would you like to see? (q to quit) ";
  chomp(my $digits = <>);
  exit if $digits eq "q";
  my $digplus3 = $digits+3;
  printf " 1/3 to $digits digits is %${digplus3}.${digits}f . \n", (1./3.);
  print  " Want to try again?  Sure you do ...  \n\n";
}
