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
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user