3 ms·
Common Lisp with SBCL: (defun double (x) (+ x x)) ; BigInts (or floats, for that matter) (defun double (x) (declare (type fixnum x)) (+ x
by ced 13y ago
Common Lisp with SBCL:
(defun double (x)
(+ x x)) ; BigInts (or floats, for that matter)
(defun double (x)
(declare (type fixnum x))
(+ x x)) ; will emit an error if X is more than a long
(defun double (x)
(declare (type fixnum x)
(optimize speed (safety 0)))
(the fixnum (+ x x))) ; trusts that everything is a long - basically like C