Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int signum(int x) {
- return x != 0 ? x / abs(x) : 0;
- }
- public static double signum(double d) {
- return (d == 0.0 || Double.isNaN(d))?d:copySign(1.0, d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement