concept primitive long in category clojure

This is an excerpt from Manning's book The Joy of Clojure, Second Edition.
Prior to Clojure 1.3, math operations auto-promoted to number objects that could handle arbitrary precision when necessary. Although this behavior is no longer the default, sometimes it’s exactly what you want, and so it’s provided in the prime math operators: +', -', *', inc', and dec'. These are spelled just like their non-promoting counterparts, but with trailing single-quote character. The following listing uses *' to allow acc to be promoted but continues to use a primitive long for x on the assumption that nobody wants to wait for this factorial function to iterate Long/MAX_VALUE times.
Listing 15.10. Factorial with auto-promotion
(defn factorial-f [^long original-x] #1 (loop [x original-x, acc 1] (if (>= 1 x) acc (recur (dec x) (*' x acc))))) #2 (factorial-f 20) ;=> 2432902008176640000 (factorial-f 30) #3 ;=> 265252859812191058636308480000000N (factorial-f 171) ;=> 124101... this goes on a while ...0000N (time (dotimes [_ 1e5] (factorial-f 20))) ; "Elapsed time: 101.7621 msecs" #4 #1 – 1 Still a primitive long argument #2 – 2 Use auto-promoting multiplication #3 – 3 No rounding as with double #4 – Faster than the original baseline !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[]"} !@%STYLE%@!Using a primitive long for original-x as declared at
allows Clojure to assume x is also a primitive long. Together this gives performance that beats the baseline back in listing 15.5.
Although the primitive long type turned out to be a poor choice for factorial, in many situations a long is perfectly acceptable. In these cases, using primitive longs with overflow checking on may be an ideal compromise between safety and performance.
allows Clojure to assume x is also a primitive long. Together this gives performance that beats the baseline back in