From ac13472bb084d17d8fc8f65b72775f98498fb776 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Tue, 4 Jul 2006 21:01:10 +0000 Subject: [PATCH] Improved javadoc for nextAfter. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@419099 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/math/util/MathUtils.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/commons/math/util/MathUtils.java b/src/java/org/apache/commons/math/util/MathUtils.java index 043a51b44..37f8bdea2 100644 --- a/src/java/org/apache/commons/math/util/MathUtils.java +++ b/src/java/org/apache/commons/math/util/MathUtils.java @@ -474,13 +474,20 @@ public final class MathUtils { } /** - * Get the closest machine representable number - * from a number in some direction. - + * Get the next machine representable number after a number, moving + * in the direction of another number. + *

+ * If direction is greater than or equal tod, + * the smallest machine representable number strictly greater than + * d is returned; otherwise the largest representable number + * strictly less than d is returned. + *

+ * If d is NaN or Infinite, it is returned unchanged. + * * @param d base number * @param direction (the only important thing is whether * direction is greater or smaller than d) - * @return + * @return the next machine representable number in the specified direction */ public static double nextAfter(double d, double direction) {