mirror of
https://github.com/corda/corda.git
synced 2025-02-07 19:40:25 +00:00
Implement the Math#signum method
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
f8028c9864
commit
6a7c03aef9
@ -75,6 +75,14 @@ public final class Math {
|
|||||||
return (int) Math.floor(v + 0.5);
|
return (int) Math.floor(v + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static double signum(double d) {
|
||||||
|
return d > 0 ? +1.0 : d < 0 ? -1.0 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float signum(float f) {
|
||||||
|
return f > 0 ? +1.0f : f < 0 ? -1.0f : 0;
|
||||||
|
}
|
||||||
|
|
||||||
public static double random() {
|
public static double random() {
|
||||||
return random.nextDouble();
|
return random.nextDouble();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user