Advertisement
Guest User

Untitled

a guest
Aug 7th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. public static int signum(int x) {
  2. return x != 0 ? x / abs(x) : 0;
  3. }
  4.  
  5. public static double signum(double d) {
  6. return (d == 0.0 || Double.isNaN(d))?d:copySign(1.0, d);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement