You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2019/07/02 21:13:34 UTC

[commons-numbers] 02/02: Formatting.

This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git

commit e44b91e461c730873c4e4e7c4e4c3dc84c73ec53
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
AuthorDate: Tue Jul 2 00:04:00 2019 +0200

    Formatting.
---
 .../org/apache/commons/numbers/fraction/Fraction.java     | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
index 49e4a17..b544192 100644
--- a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
+++ b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
@@ -83,8 +83,7 @@ public class Fraction
      * @throws IllegalArgumentException if the continued fraction failed to
      *         converge.
      */
-    private Fraction(double value, double epsilon, int maxDenominator, int maxIterations)
-    {
+    private Fraction(double value, double epsilon, int maxDenominator, int maxIterations) {
         long overflow = Integer.MAX_VALUE;
         double r0 = value;
         long a0 = (long)Math.floor(r0);
@@ -193,6 +192,7 @@ public class Fraction
         this.numerator   = num;
         this.denominator = den;
     }
+
     /**
      * Create a fraction given the double value.
      * @param value the double value to convert to a fraction.
@@ -221,8 +221,7 @@ public class Fraction
      *         converge.
      * @return {@link Fraction} instance
      */
-    public static Fraction from(double value, double epsilon, int maxIterations)
-    {
+    public static Fraction from(double value, double epsilon, int maxIterations) {
         return new Fraction(value, epsilon, Integer.MAX_VALUE, maxIterations);
     }
 
@@ -241,8 +240,7 @@ public class Fraction
      *         converge
      * @return {@link Fraction} instance
      */
-    public static Fraction from(double value, int maxDenominator)
-    {
+    public static Fraction from(double value, int maxDenominator) {
        return new Fraction(value, 0, maxDenominator, 100);
     }
 
@@ -373,7 +371,7 @@ public class Fraction
      */
     @Override
     public int intValue() {
-        return (int)doubleValue();
+        return (int) doubleValue();
     }
 
     /**
@@ -383,7 +381,7 @@ public class Fraction
      */
     @Override
     public long longValue() {
-        return (long)doubleValue();
+        return (long) doubleValue();
     }
 
     /**
@@ -628,5 +626,4 @@ public class Fraction
             return of(num, denom);
         }
     }
-
 }