Liking cljdoc? Tell your friends :D

broch.core


*clj/s

(*)
(* x)
(* x y)
(* x y & more)
source

+clj/s

(+)
(+ x)
(+ x y)
(+ x y & more)
source

-clj/s

(- x)
(- x y)
(- x y & more)
source

/clj/s

(/ x)
(/ x y)
(/ x y & more)
source

<clj/s

(< _)
(< x y)
(< x y & more)
source

<=clj/s

(<= _)
(<= x y)
(<= x y & more)
source

>clj/s

(> _)
(> x y)
(> x y & more)
source

>=clj/s

(>= _)
(>= x y)
(>= x y & more)
source

acresclj/s

source

amperesclj/s

source

becquerelsclj/s

source

boxclj/s

(box f)

Like boxed but partial.

Like boxed but partial.
sourceraw docstring

boxedclj/s

(boxed f x)

Transform the quantity's number by any fn (i.e. fmap on the quantity-functor). Also works for numbers.

Beware:

  1. The return value is not checked, and quantities with non-numeric values will cause parts of broch to break.
  2. In cljs, broch quantities will sometimes have a ratio number type that is not a regular js Number. These will fail with clojure.core arithmetic ops (+,-,*,/), so use the ops from broch.core instead.
Transform the quantity's number by any fn (i.e. fmap on the quantity-functor). Also works for numbers.

Beware:
1. The return value is not checked, and quantities with non-numeric values will cause parts of broch to break.
2. In cljs, broch quantities will sometimes have a ratio number type that is not a regular js Number.
   These will fail with clojure.core arithmetic ops (+,-,*,/), so use the ops from broch.core instead.
sourceraw docstring

candelasclj/s

source

centilitersclj/s

source

centimetersclj/s

source

compatible-unitsclj/s

(compatible-units quantity)

Returns units with the same measure as quantity.

Returns units with the same measure as quantity.
sourceraw docstring

compositionclj/s

(composition q)

The composition of this quantity.

The composition of this quantity.
sourceraw docstring

coulombsclj/s

source

cubic-centimetersclj/s

source

cubic-feetclj/s

source

cubic-inchesclj/s

source

cubic-kilometersclj/s

source

cubic-metersclj/s

source

cubic-milesclj/s

source

cubic-millimetersclj/s

source

cubic-yardsclj/s

source

decilitersclj/s

source

decimetersclj/s

source

defunitclj/smacro

(defunit unit-fn-name measure symb scale-or-comp)
(defunit unit-fn-name measure symb scaling composition)

Can be used to define units, but it's not compatible with cljs. Alternatively use the form this expands to: (def unit-fn-name (new-unit measure symbol scaling composition))

Can be used to define units, but it's not compatible with cljs.
Alternatively use the form this expands to:
(def unit-fn-name (new-unit measure symbol scaling composition))
sourceraw docstring

defunit-onceclj/smacro

(defunit-once unit-fn-name measure symb scale-or-comp)
(defunit-once unit-fn-name measure symb scaling composition)

Can be used to define units, but it's not compatible with cljs. Alternatively use the form this expands to: (defonce unit-fn-name (new-unit measure symbol scaling composition))

Can be used to define units, but it's not compatible with cljs.
Alternatively use the form this expands to:
(defonce unit-fn-name (new-unit measure symbol scaling composition))
sourceraw docstring

equivalent-quantitiesclj/s

(equivalent-quantities quantity)

Returns quantities with compatible units equivalent to the given one.

Returns quantities with compatible units equivalent to the given one.
sourceraw docstring

faradsclj/s

source

feetclj/s

source

from-ednclj/s

(from-edn x)
source

gramsclj/s

source

grams-per-cubic-centimeterclj/s

source

grams-per-square-centimeterclj/s

source

graysclj/s

source

henrysclj/s

source

hertzclj/s

source

hertz-per-secondclj/s

source

hoursclj/s

source

inchesclj/s

source

joulesclj/s

source

katalsclj/s

source

kelvinclj/s

source

kilogramsclj/s

source

kilograms-per-cubic-meterclj/s

source

kilograms-per-hourclj/s

source

kilograms-per-literclj/s

source

kilograms-per-secondclj/s

source

kilograms-per-square-centimeterclj/s

source

kilograms-per-square-meterclj/s

source

kilometersclj/s

source

kilometers-per-hourclj/s

source

kilowatt-hoursclj/s

source

kilowattsclj/s

source

knotsclj/s

source

litersclj/s

source

liters-per-hourclj/s

source

liters-per-secondclj/s

source

long-tonsclj/s

source

lumensclj/s

source

luxclj/s

source

maxclj/s

(max x)
(max x y)
(max x y & more)
source

measureclj/s

(measure q)

What this quantity is a measure of.

What this quantity is a measure of.
sourceraw docstring

metersclj/s

source

meters-per-secondclj/s

source

meters-per-second2clj/s

source

microgramsclj/s

source

micrograms-per-square-millimeterclj/s

source

microsecondsclj/s

source

milesclj/s

source

miles-per-hourclj/s

source

milligramsclj/s

source

millimetersclj/s

source

millisecondsclj/s

source

minclj/s

(min x)
(min x y)
(min x y & more)
source

minutesclj/s

source

molesclj/s

source

nanogramclj/s

source

nanosecondsclj/s

source

nautical-milesclj/s

source

new-unitclj/s

(new-unit measure symb scale-or-comp)
(new-unit measure symb scaling composition)

Register a new type of unit with the given measure, symbol, composition and/or scaling. Returns a fn (fn [number]) that creates a quantity of this unit.

Register a new type of unit with the given measure, symbol, composition and/or scaling.
Returns a fn (fn [number]) that creates a quantity of this unit.
sourceraw docstring

newton-metersclj/s

source

newtonsclj/s

source

nicestclj/s

(nicest quantity)
(nicest quantity unit-options)

Returns the quantity converted to the "nicest" compatible unit for printing.

"nicest" being defined as the one with the shortest printed number, preferring precise doubles over ratios if available (as ratios can be harder to read).

The 1-arity implementation uses all compatible units as options. This is not recommended for most cases, as broch includes some "weird" units that are often unwanted.

Example: (b/nicest (b/meters 18520)) => #broch/quantity[10 "NM"] ; nautical miles may be unwanted (b/nicest (b/meters 18520) [b/meters b/kilometers]) => #broch/quantity[18.52 "km"]

Returns the quantity converted to the "nicest" compatible unit for printing.

"nicest" being defined as the one with the shortest printed number,
preferring precise doubles over ratios if available (as ratios can be harder to read).

The 1-arity implementation uses all compatible units as options.
This is not recommended for most cases, as broch includes some "weird" units that are often unwanted.

Example:
(b/nicest (b/meters 18520)) => #broch/quantity[10 "NM"] ; nautical miles may be unwanted
(b/nicest (b/meters 18520) [b/meters b/kilometers]) => #broch/quantity[18.52 "km"]
sourceraw docstring

numclj/s

(num q)

Get the number from a quantity. Pass through if already a number.

Get the number from a quantity. Pass through if already a number.
sourceraw docstring

ohmsclj/s

source

ounceclj/s

source

ounces-per-square-inchclj/s

source

pascalsclj/s

source

picogramclj/s

source

poundsclj/s

source

pounds-per-cubic-footclj/s

source

pounds-per-square-footclj/s

source

pounds-per-square-inchclj/s

source

quantityclj/s

(quantity unit x)

Makes a new quantity of unit and x.

  • unit must be a quantity (but the number part is ignored).
  • x must be number-ish, i.e. a number, string of number, or another quantity. If x is a quantity, it will be converted (or throw exception if incompatible).
Makes a new quantity of unit and x.
- unit must be a quantity (but the number part is ignored).
- x must be number-ish, i.e. a number, string of number, or another quantity.
  If x is a quantity, it will be converted (or throw exception if incompatible).
sourceraw docstring

quantity?clj/s

(quantity? q)

Is this a quantity?

Is this a quantity?
sourceraw docstring

radiansclj/s

source

radians-per-secondclj/s

source

radians-per-second-squaredclj/s

source

secondsclj/s

source

short-tonsclj/s

source

siemensclj/s

source

sievertsclj/s

source

square-centimetersclj/s

source

square-decimetersclj/s

source

square-feetclj/s

source

square-inchesclj/s

source

square-kilometersclj/s

source

square-metersclj/s

source

square-milesclj/s

source

square-millimetersclj/s

source

square-yardsclj/s

source

steradiansclj/s

source

symbolclj/s

(symbol q)

The unit symbol for this quantity.

The unit symbol for this quantity.
sourceraw docstring

tagsclj/s

source

teslasclj/s

source

to-ednclj/s

(to-edn u)
source

tonnesclj/s

source

tonnes-per-hourclj/s

source

voltsclj/s

source

watt-hoursclj/s

source

wattsclj/s

source

webersclj/s

source

with-numclj/s

(with-num quantity n)

Make copy of a quantity with a different number.

Make copy of a quantity with a different number.
sourceraw docstring

yardsclj/s

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close