<commit_before>(ns uxbox.util.math
  "A collection of math utils."
  (:require [goog.math :as math]))

(defn abs
  [^number v]
  (js/Math.abs v))

(defn sin
  "Returns the sine of a number"
  [^number v]
  (js/Math.sin v))

(defn cos
  "Returns the cosine of a number."
  [^number v]
  (js/Math.cos v))

(defn tan
  "Returns the tangent of a number."
  [^number v]
  (js/Math.tan v))

(defn neg
  "Negate the number"
  [^number v]
  (- v))

(defn floor
  "Returns the largest integer less than or
  equal to a given number."
  [^number v]
  (js/Math.floor v))

(defn round
  "Returns the value of a number rounded to
  the nearest integer."
  [^number v]
  (js/Math.round v))

(defn ceil
  "Returns the smallest integer greater than
  or equal to a given number."
  [^number v]
  (js/Math.ceil v))

(defn radians
  "Converts degrees to radians."
  [^number degrees]
  (math/toRadians degrees))

(defn degrees
  "Converts radians to degrees."
  [^number radiants]
  (math/toDegrees radiants))
<commit_msg>Add `precision` helper on math ns.<commit_after>(ns uxbox.util.math
  "A collection of math utils."
  (:require [goog.math :as math]))

(defn abs
  [^number v]
  (js/Math.abs v))

(defn sin
  "Returns the sine of a number"
  [^number v]
  (js/Math.sin v))

(defn cos
  "Returns the cosine of a number."
  [^number v]
  (js/Math.cos v))

(defn tan
  "Returns the tangent of a number."
  [^number v]
  (js/Math.tan v))

(defn neg
  "Negate the number"
  [^number v]
  (- v))

(defn floor
  "Returns the largest integer less than or
  equal to a given number."
  [^number v]
  (js/Math.floor v))

(defn round
  "Returns the value of a number rounded to
  the nearest integer."
  [^number v]
  (js/Math.round v))

(defn ceil
  "Returns the smallest integer greater than
  or equal to a given number."
  [^number v]
  (js/Math.ceil v))

(defn precision
  [^number v ^number n]
  (js/parseFloat (.toFixed v n)))

(defn radians
  "Converts degrees to radians."
  [^number degrees]
  (math/toRadians degrees))

(defn degrees
  "Converts radians to degrees."
  [^number radiants]
  (math/toDegrees radiants))

{'fraction_non_alphanumeric': 0.12975285171102663, 'fraction_numerical': 0.0, 'mean_word_length': 3.1600790513833994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3361940', 'n_tokens_mistral': 807, 'n_tokens_neox': 773, 'n_words': 283}