Java Abs abs_fractional(double number)

Here you can find the source of abs_fractional(double number)

Description

abfractional

License

Open Source License

Declaration

public static double abs_fractional(double number) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double abs_fractional(double number) {
        double fr = fractional(number);

        if (fr >= 0.0)
            return fr;

        fr += 1.0;//from  w w w  .  ja  v  a2s  .com
        if (fr >= 1.0) //can happen due to epsilon errors
            return 0.0;

        return fr;
    }

    public static double fractional(double number) {
        int decimal = (int) number;
        return (number - decimal);
    }
}

Related

  1. abs(long index)
  2. Abs(Object in)
  3. abs(short x)
  4. abs2(double[][] IN)
  5. abs2(float[] f)
  6. abs_min(double a, double b)
  7. absAngleDifference(double angle1Radians, double angle2Radians)
  8. absApproximation(double x, double M)
  9. absCap(double value, double bounds)