Back

log10 (clj)

(source)

function

(log10 a)
Returns the logarithm (base 10) of a. If a is ##NaN or negative => ##NaN If a is ##Inf => ##Inf If a is zero => ##-Inf See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#log10-double-

Examples

clojure
(ns clojure.test-clojure.math
  (:require
    [clojure.test :refer :all]
    [clojure.math :as m]))

(deftest test-log10
  (is (NaN? (m/log10 ##NaN)))
  (is (NaN? (m/log10 -1.0)))
  (is (= ##Inf (m/log10 ##Inf)))
  (is (= ##-Inf (m/log10 0.0)))
  (is (ulp= (m/log10 10) 1.0 1)))