From 6947e679d60fb9e0b52ea1af350dc6af641dde8a Mon Sep 17 00:00:00 2001 From: wosch Date: Tue, 23 Sep 1997 12:47:47 +0000 Subject: [PATCH] Float overflow in statistic function for large databases (>100MB characters). --- usr.bin/locate/locate/fastfind.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index 8a46b0f7372f..d886ffa55667 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: fastfind.c,v 1.9 1997/02/22 19:55:45 peter Exp $ + * $Id: fastfind.c,v 1.10 1997/07/21 12:08:13 charnier Exp $ */ @@ -89,10 +89,10 @@ statistic (fp, path_fcodes) (void)printf("\nDatabase: %s\n", path_fcodes); (void)printf("Compression: Front: %2.2f%%, ", - (float)(100 * (size + big - (2 * NBG))) / chars); - (void)printf("Bigram: %2.2f%%, ", (float)(100 * (size - big)) / size); + (size + big - (2 * NBG)) / (chars / (float)100)); + (void)printf("Bigram: %2.2f%%, ", (size - big) / (size / (float)100)); (void)printf("Total: %2.2f%%\n", - (float)(100 * (size - (2 * NBG))) / chars); + (size - (2 * NBG)) / (chars / (float)100)); (void)printf("Filenames: %d, ", lines); (void)printf("Characters: %d, ", chars); (void)printf("Database size: %d\n", size);