Why does Signum return a float?

The $1.0e6 question!
I could never figure this out on my own.

It doesnt?:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#signum(int)

I cannot believe I missed the Integer class. :o
I’m silly. ::slight_smile:

I was using these 2:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html#signum(double)
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html#signum(float)

Thanks.

Odd that the method wasn’t included for bytes, shorts and ints too, just for completeness.

Cas :slight_smile:

You grab your mallet, I’ll grab my armour and we’ll meet the Sun engineers responsible. :stuck_out_tongue:

Or you could just submit a patch to Java 7 :slight_smile:

that signum in Integer isn’t that old either…