Is there reason why abs is not part of the Numbers interface?

Currently I need to differentiate between binary decimals and
BigDecimals:

(. java.lang.Math (abs -1))
1
(. -1M (abs))
1M

And if I accidentally use BigDecimal in the wrong place I get an NPE:

(. java.lang.Math (abs -1M))
java.lang.NullPointerException (NO_SOURCE_FILE:0)

Would be nice to be able to use:

(abs -1.0)
1
(abs 1.0M)
1M

and get the overloading provided by the Numbers interface.

Cheers,
Paul Drummond
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to