From c3a736890eb3065324278fda0b73fc9669a39f3b Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 7 Jul 2006 17:11:45 +0000 Subject: [PATCH] Ah, actually the documentation begged to differ. Well checking for a zero numerator is stupid because the math just works, so we'll keep the new behavior and change the documentation because I'm tired of seeing giant div0 exceptions in the logs and the fix will no doubt to be to find those places and change them to display zero if the denominator is zero which is exactly what we're doing here anyway. It's the new math. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1871 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/velocity/DataTool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/com/samskivert/velocity/DataTool.java b/src/java/com/samskivert/velocity/DataTool.java index b1829f02..2ca90e82 100644 --- a/src/java/com/samskivert/velocity/DataTool.java +++ b/src/java/com/samskivert/velocity/DataTool.java @@ -47,7 +47,7 @@ public class DataTool /** * Returns the numerator as a percentage of the denominator (100 * num / - * denom), handles 0/0 (returns 0), but will div0 on N/0 where N != 0. + * denom), handles 0/0 (returns 0) and returs 0 when denom is 0. */ public int percent (int num, int denom) {