0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

Add floor/ceil/round functions to math utils ns.

This commit is contained in:
Andrey Antukh 2016-01-20 18:42:55 +02:00
parent 9b3e41432c
commit fd1d6e1420

View file

@ -26,6 +26,24 @@
[^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]