Miscellaneous functions.
Miscellaneous functions.
(->bigdec-2 val)
Inputs: [val :- (s/cond-pre s/Num s/Str)] Returns: BigDecimal
Coerces a numeric value to a BigDecimal with 2 decimal digits. Also accepts a numeric value encoded as a String.
Inputs: [val :- (s/cond-pre s/Num s/Str)] Returns: BigDecimal Coerces a numeric value to a BigDecimal with 2 decimal digits. Also accepts a numeric value encoded as a String.
(->bigdec-N val N)
Inputs: [val :- (s/cond-pre s/Num s/Str) N :- s/Int] Returns: BigDecimal
Coerces a numeric value to a BigDecimal with N decimal digits. Also accepts a numeric value encoded as a String.
Inputs: [val :- (s/cond-pre s/Num s/Str) N :- s/Int] Returns: BigDecimal Coerces a numeric value to a BigDecimal with N decimal digits. Also accepts a numeric value encoded as a String.
(binary-chars->BigInteger bin-chars)
Inputs: [bin-chars :- [Character]] Returns: BigInteger
Converts a binary char sequence into a (positive) BigInteger
Inputs: [bin-chars :- [Character]] Returns: BigInteger Converts a binary char sequence into a (positive) BigInteger
(binary-str->BigInteger bin-str)
Inputs: [bin-str :- s/Str] Returns: BigInteger
Converts a binary char sequence into a (positive) BigInteger
Inputs: [bin-str :- s/Str] Returns: BigInteger Converts a binary char sequence into a (positive) BigInteger
(factorial n)
Inputs: [n :- s/Int] Returns: s/Int
Computes the factorial of N
Inputs: [n :- s/Int] Returns: s/Int Computes the factorial of N
(int->binary-chars bi)
Inputs: [bi :- s/Int] Returns: [Character]
Converts a (positive) BigInteger into a binary char sequence
Inputs: [bi :- s/Int] Returns: [Character] Converts a (positive) BigInteger into a binary char sequence
(int->binary-str ival)
Inputs: [ival :- s/Int] Returns: s/Str
Converts an integer into a binary String
Inputs: [ival :- s/Int] Returns: s/Str Converts an integer into a binary String
(int->bitchars ival bits-width)
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: tsk/Vec
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: tsk/Vec
(int->bitstr ival bits-width)
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: s/Str
Inputs: [ival :- s/Int bits-width :- s/Int] Returns: s/Str
(int->hex-str ival min-width)
Inputs: [ival :- s/Int min-width :- s/Int] Returns: s/Str
Converts a (positive) BigInteger into a hex string of min-width
chars
Inputs: [ival :- s/Int min-width :- s/Int] Returns: s/Str Converts a (positive) BigInteger into a hex string of `min-width` chars
(log2 x)
Inputs: [x :- s/Num] Returns: Double
Returns the log base-2 of x
Inputs: [x :- s/Num] Returns: Double Returns the log base-2 of x
(pow->BigInteger base exp)
Inputs: [base :- s/Int exp :- s/Int] Returns: BigInteger
An BigInteger version of java.Math/pow( base, exp )
Inputs: [base :- s/Int exp :- s/Int] Returns: BigInteger An BigInteger version of java.Math/pow( base, exp )
(pow->Long base exp)
Inputs: [base :- s/Int exp :- s/Int] Returns: s/Int
An Long (integer) version of java.Math/pow( base, exp )
Inputs: [base :- s/Int exp :- s/Int] Returns: s/Int An Long (integer) version of java.Math/pow( base, exp )
(round-N val N)
Inputs: [val :- s/Num N :- s/Int] Returns: Double
Round a floating point number to N decimal places, returning a double.
(round-decimals 3.14156 2) => 3.14
(round-decimals 1234567 -2) => 1234500
Inputs: [val :- s/Num N :- s/Int] Returns: Double Round a floating point number to N decimal places, returning a double. (round-decimals 3.14156 2) => 3.14 (round-decimals 1234567 -2) => 1234500
(same-sign x y)
Inputs: [x :- s/Num y :- s/Num] Returns: s/Bool
Returns true
iff x and y have the same sign, or are both zero.
Inputs: [x :- s/Num y :- s/Num] Returns: s/Bool Returns `true` iff x and y have the same sign, or are both zero.
(signum x)
Inputs: [x :- s/Num] Returns: s/Int
Returns either -1, 0, or +1, to indicate the sign of the input.
Inputs: [x :- s/Num] Returns: s/Int Returns either -1, 0, or +1, to indicate the sign of the input.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close