JDK-4248618 : Math.ceil and Math.floor doc incorrect
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 1999-06-22
  • Updated: 1999-11-01
  • Resolved: 1999-11-01
Related Reports
Duplicate :  
Description

Name: skT88420			Date: 06/22/99


Math.ceil(-2.5)  returns -3.0, which is less than -2.5.  
Your method description states that the return value 
"is not less than the argument".

You need to clarify behavior for negative numbers.
Same thing for Math.floor().

ceil

public static double ceil(double a)

     Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a
     mathematical integer.
     Parameters:
          a - a double value. 
     Returns:
          the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a
          mathematical integer.
(Review ID: 84673) 
======================================================================

Comments
EVALUATION Closing as not a bug. Math.ceil(-2.5) gives me -2.0 Math.floor(-2.5) gives me -3.0, which is consistent with the docs. ###@###.### 1999-11-01
01-11-1999