Package fr.formiko.usuel.maths
Class math
java.lang.Object
fr.formiko.usuel.maths.math
Do math operation.
- Author:
- Hydrolien
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
between(double min, double max, double val)
Return a value in an interval.static float
between(float min, float max, float val)
Return a value in an interval.static int
between(int min, int max, int val)
Return a value in an interval.static long
factorielle(int k)
return k!static int
kParmiN(int k, int n)
n choose kstatic double
max(double... t)
return maximumstatic double
max(double x, double y)
return maximumstatic int
max(int... t)
return maximumstatic int
max(int[][] t)
return maximumstatic int
max(int x, int y)
return maximumstatic double
min(double... t)
return minimumstatic double
min(double x, double y)
return minimumstatic int
min(int... t)
return minimumstatic int
min(int[][] t)
return minimumstatic int
min(int x, int y)
return minimumstatic int
sommeDe0AX(int k)
return the sum from 0 to kstatic int
sommeDe0AXSwitch(int k)
return the sum from 0 to kstatic int
syracuse(int n)
Syracuse suitestatic int
syracuseSwitch(int n)
Syracuse suitestatic double
valAbs(double x)
return absolute valuestatic int
valAbs(int x)
return absolute value
-
Constructor Details
-
math
public math()
-
-
Method Details
-
max
public static int max(int x, int y)return maximum- Returns:
- maximum of 2 int
-
max
public static int max(int... t)return maximum Sort cut for as many parameters as we whant.- Returns:
- maximum of int t []
-
max
public static int max(int[][] t)return maximum- Returns:
- maximum of int t [][]
-
min
public static int min(int x, int y)return minimum- Returns:
- minimum of 2 int
-
min
public static int min(int... t)return minimum- Returns:
- minimum of int t []
-
min
public static int min(int[][] t)return minimum- Returns:
- minimum of int t [][]
-
valAbs
public static int valAbs(int x)return absolute value- Returns:
- absolute value of an int.
-
max
public static double max(double x, double y)return maximum- Returns:
- maximum of double
-
max
public static double max(double... t)return maximum- Returns:
- maximum of double
-
min
public static double min(double x, double y)return minimum- Returns:
- minimum of double
-
min
public static double min(double... t)return minimum- Returns:
- minimum of double
-
valAbs
public static double valAbs(double x)return absolute value- Returns:
- absolute value of double
-
between
public static int between(int min, int max, int val)Return a value in an interval.
max & min are in the interval.- Parameters:
min
- the minimum valuemax
- the maximum valueval
- the value to test- Returns:
- val or a bound
-
between
public static float between(float min, float max, float val)Return a value in an interval.
max & min are in the interval.- Parameters:
min
- the minimum valuemax
- the maximum valueval
- the value to test- Returns:
- val or a bound
-
between
public static double between(double min, double max, double val)Return a value in an interval.
max & min are in the interval.- Parameters:
min
- the minimum valuemax
- the maximum valueval
- the value to test- Returns:
- val or a bound
-
sommeDe0AXSwitch
public static int sommeDe0AXSwitch(int k)return the sum from 0 to k- Returns:
- sum from 0 to k
-
sommeDe0AX
public static int sommeDe0AX(int k)return the sum from 0 to k- Returns:
- sum from 0 to k or -1 if k < 0
-
factorielle
public static long factorielle(int k)return k!- Returns:
- k! or -1 if k < 0
-
kParmiN
public static int kParmiN(int k, int n)n choose k- Returns:
- n choose k
-
syracuse
public static int syracuse(int n)Syracuse suite- Returns:
- Syracuse suite
-
syracuseSwitch
public static int syracuseSwitch(int n)Syracuse suite- Returns:
- Syracuse suite
-