JuliaLang/julia — pull request #9303 by phobon (2014-12-10 20:01:52+00:00)
Title: Let sign(x) work on unsigned arguments

I figured I would just directly create the pull request for this very small change and have the discussion here rather than starting with an issue.

Currently, the `sign` function throws an `InexactError` on unsigned arguments because it uses `ifelse` and therefore `oftype(x, -1)` is evaluated before `x < 0`.

In case this was actually a design choice, I would suggest it should still be changed, as `sign` has a clear mathematical definition independent of it's argument type, and other computing environments I've tried have no problem returning `1` for an unsigned integer.