/* round.h Written by Warren M Myers 16 Nov 99 Usage and explanation below. */ #ifndef ROUND_H #define ROUND_H long double Round(long double, unsigned long int); #include /* function to round any number at a given precision */ /* precision is factor of ten, (1000ths would be 3 precision) */ /* Usage: ans = Round(number, d); --> round number at d decimal points and put the result into the variable ans. ans = Round(7.3429562, 2); --> round the number 7.3429562 at 2 decimal points and put the answer into ans (ans = 7.34) To use in program: #include "round.h" */ long double Round(long double number, unsigned long int precision){ unsigned long int tenFactor = 10; unsigned long int intermediateAnswer = 0; unsigned long int loopCount = 0; long double result; for(;loopCount