(unchecked-long x)
Coerce to long. Subject to rounding or truncation.
(unchecked-long 1)
;;=> 1
(unchecked-long 1N)
;;=> 1
(unchecked-long 1.1)
;;=> 1
(unchecked-long 1.9)
;;=> 1
(unchecked-long 5/3)
;;=> 1
(unchecked-long -1)
;;=> -1
(unchecked-long -1N)
;;=> -1
(unchecked-long -1.1)
;;=> -1
(unchecked-long -1.9)
;;=> -1
(unchecked-long -5/3)
;;=> -1
;;;; Note that (unchecked-long) does not range check its argument
;;;; so integer overflow or rounding may occur.
;;;; Use (long) if you want to throw an exception in such cases.
(unchecked-long 9223372036854775808N)
;;=> -9223372036854775808
(unchecked-long -9223372036854775809N)
;;=> 9223372036854775807
(long 9223372036854775808N)
;;=> IllegalArgumentException Value out of range for long: 922337203685477580
(long -9223372036854775809N)
;;=> IllegalArgumentException Value out of range for long: -9223372036854775809
(unchecked-long 1.0E18)
;;=> 1000000000000000000
(unchecked-long 1.0E19)
;;=> 9223372036854775807
(unchecked-long 1.0E20)
;;=> 9223372036854775807
(long 1.0E18)
;;=> 1000000000000000000
(long 1.0E19)
;;=> IllegalArgumentException Value out of range for long: 1.0E19
(long 1.0E20)
;;=> IllegalArgumentException Value out of range for long: 1.0E20