package
4.0.0+incompatible
Repository: https://github.com/blackchip-org/zc.git
Documentation: pkg.go.dev
# Functions
oper abs
func AbsBigInt p0:BigInt -- BigInt
func AbsDecimal p0:Decimal -- Decimal
func AbsFloat p0:Float -- Float
func AbsRational p0:Rational -- Rational
func AbsComplex p0:Complex -- Complex
title Absolute value
desc
For non-complex numbers: If *p0* is less than zero, the negated value of *p0*,
otherwise *p0*.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
oper acos
func AcosFloat p0:Float -- Float
title Inverse cosine
desc
Inverse cosine of *p0* in radians.
oper acosh
func AcoshFloat p0:Float -- Float
title Inverse hyperbolic cosine
desc
Inverse cosine of *p0* in radians.
oper add
func AddBigInt p0:BigInt p1:BigInt -- BigInt
func AddDecimal p0:Decimal p1:Decimal -- Decimal
func AddFloat p0:Float p1:Float -- Float
func AddRational p0:Rational p1:Rational -- Rational
func AddComplex p0:Complex p1:Complex -- Complex
alias a
alias +
title Addition
desc
Adds the value of *p1* to *p0*.
No description provided by the author
No description provided by the author
No description provided by the author
oper add
func AddDuration p0:Duration p1:Duration -- Duration
func AddDurationDateTime p0:Duration p1:DateTime -- Duration
func AddDateTimeDuration p0:DateTime p1:Duration -- Duration
alias a
alias +
title Time or duration addition
desc
Adds a duration and time or adds two durations.
No description provided by the author
No description provided by the author
No description provided by the author
oper and
func AndBigInt p0:BigInt p1:BigInt -- BigInt
title Bitwise and
desc
The bitwise and of `p0` and `p1`
end
example
0b1100 -- 0b1100
0b1010 -- 0b1100 | 0b1010
and bin -- 0b1000
end
*/.
oper and
func AndBool p0:Bool p1:Bool -- Bool
title Logical conjunction
desc
The logical conjunction of *p0* and *p1*.
oper asin
func AsinFloat p0:Float -- Float
title Inverse sine
desc
Inverse sine of *p0* in radians.
oper asinh
func AsinhFloat p0:Float -- Float
title Inverse hyperbolic sine
desc
Inverse hyperbolic sine of *p0* in radians.
oper atan
func AtanFloat p0:Float -- Float
title Inverse tangent
desc
Inverse tangent of *p0* in radians.
oper atanh
func AtanhFloat p0:Float -- Float
title Inverse hyperbolic tangent
desc
Inverse hyperbolic tangent of *p0* in radians.
oper bin
func Bin p0:BigInt -- BigInt
title Binary conversion
desc
Convert the value of *p0* to a binary number.
oper bit
func Bit p0:BigInt n:Int -- Uint
title Bit value
desc
The value of the *n*th bit of *p0*.
oper bits
func Bits p0:BigInt -- Int
title Length in bits
desc
The length of *p0* in bits.
oper bytes
func Bytes p0:BigInt -- Int
title Length in bytes
desc
The length of *p0* in bytes.
oper ceil
func NoOp p0:BigInt -- BigInt
func CeilDecimal p0:Decimal -- Decimal
func CeilFloat p0:Float -- Float
title Ceiling
desc
The nearest integer value greater than or equal to *p0*.
No description provided by the author
oper char-codepoint
func CharToCodePoint p0:Char -- Int32
alias char-cp
title Character to code point
desc
Converts the character *p0* into an integer code point.
oper clear
func Clear ..
oper cmyk-rgb
func CMYKToRGB c:Uint8 m:Uint8 y:Uint8 k:Uint8 -- r:Uint8 g:Uint8 b:Uint8
title CMYK to RGB color space
desc
Convert the CMYK color *c*, *m*, *y*, *k*, to the RGB color space as *r*, *b*,
*g*.
oper codepoint-char
func CodePointToChar p0:Int32 -- Char
alias cp-char
title Code point to character
desc
Coverts the code point *p0* to a character.
oper color-sample
func ColorSample r:Uint8 g:Uint8 b:Uint8 -- Str
title Render a sample of a color
desc
Render five spaces with a background color of *r*, *g*, and *b*.
oper complex
func Complex r:Float i:Float -- Float
title Complex from real and imaginary
desc
A complex number from a real *r* and an imaginary *i* number.
oper cos
func CosFloat p0:Float -- Float
title Cosine
desc
Cosine of *p0* in radians.
oper cosh
func CoshFloat p0:Float -- Float
title Hyperbolic cosine
desc
Hyperbolic cosine of *p0* in radians.
oper date
func Date p0:DateTime -- Date
title Formats to a common date layout
desc
Formats date/time *p0* to a common date layout.
oper datetime
func DateTime p0:DateTime -- DateTime
alias dt
title Formats to a common date/time layout
desc
Formats a date/time to a common layout.
oper day-year
func DayYear p0:DateTime -- Int
alias doy
title Day of year
desc
Day of year for a given date *p0*.
oper dec
func Dec p0:Decimal -- Decimal
func DecFloat p0:Float -- Decimal
title Decimal number
desc
Pops *p0* from the stack and formats it as a `Decimal`.
oper dec
func DecBigInt p0:BigInt -- BigInt
title Decimal conversion
desc
Convert the value of *p0* to a decimal number.
No description provided by the author
No description provided by the author
oper div
func DivDecimal p0:Decimal p1:Decimal -- Decimal
func DivFloat p0:Float p1:Float -- Float
func DivRational p0:Rational p1:Rational -- Rational
func DivComplex p0:Complex p1:Complex -- Complex
alias d
alias /
title Division
desc
Divides the value of *p0* by *p1*.
No description provided by the author
No description provided by the author
oper down
func Down ..
oper drop
func Drop Val --
title Drop top item from stack
desc
Remove the top item from the stack.
oper dup
func Dup p0:Val -- p0:Val p0:Val
title Duplicate top stack item
desc
Duplicate the top item on the stack.
oper eq
func EqBigInt p0:BigInt p1:BigInt -- BigInt
func EqDecimal p0:Decimal p1:Decimal -- Decimal
func EqFloat p0:Float p1:Float -- Float
func EqRational p0:Rational p1:Rational -- Rational
func EqComplex p0:Complex p1:Complex -- Complex
func Is p0:Str p1:Str -- Str
title Equal
desc
`true` if *p0* and *p1* are equal, otherwise `false`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
oper eval
func Eval Val* expr:Str -- Val*
title Evaluate top of stack
desc
Evaluate *expr* as if it was input to the calculator.
oper exp
func ExpFloat p0:Float -- Float
title Natural exponential
desc
Natural exponential of *p0*.
oper filter
func Filter Val* expr:Str -- Val*
title Filter items in the stack
desc
Filter the stack by keeping items that are true when evaluated by
expression *expr*.
oper floor
func NoOp p0:BigInt -- BigInt
func FloorDecimal p0:Decimal -- Decimal
func FloorFloat p0:Float -- Float
title Floor
desc
The nearest integer value less than or equal to *p0*.
No description provided by the author
oper fold
func Fold Val* expr:Str -- Val
alias reduce
title Reduce items to a single value
desc
Reduce the stack to a single value using the expression *expr*.
oper gt
func GtBigInt p0:BigInt p1:BigInt -- Bool
func GtDecimal p0:Decimal p1:Decimal -- Bool
func GtRational p0:Rational p1:Rational -- Bool
func GtFloat p0:Float p1:Float -- Bool
func GtStr p0:Str p1:Str -- Bool
alias greater-than
title Greater than
desc
`true` if *p0* is greater than *p1*, otherwise `false`.
No description provided by the author
oper gte
func GteBigInt p0:BigInt p1:BigInt -- Bool
func GteDecimal p0:Decimal p1:Decimal -- Bool
func GteRational p0:Rational p1:Rational -- Bool
func GteFloat p0:Float p1:Float -- Bool
func GteStr p0:Str p1:Str -- Bool
alias greater-than-or-equal
title Greater than or equal
desc
`true` if *p0* is greater than or equal *p1*, otherwise `false`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
oper hex
func HexBigInt p0:BigInt -- BigInt
title Hexadecimal conversion
desc
Convert the value of *p0* to a hexadecimal number.
oper hours
func Hours p0:Duration -- Float
title Hours in duration
desc
Converts the duration *p0* into hours.
oper hsl-rgb
func HSLToRGB h:Float s:Float l:Float -- r:Uint8 g:Uint8 b:Uint8
title HSL to RGB color space
desc
Convert the HSL color *h*, *s*, *l* to the RGB color space as *r*, *g*, *b*.
No description provided by the author
oper is
func Is p0:Str p1:Str -- Bool
title Byte equality
desc
`true` if *p0* and *p1* are the same, byte by byte.
oper is-not
func IsNot p0:Str p1:Str -- Bool
title Byte inequality
desc
`true` if *p0* and *p1* are not same, byte by byte.
oper join
func Join Val* sep:Str -- Str
title Join stack elements
desc
Join all stack elements into a single string separated by *sep*.
oper left
func Left p0:Str n:Int -- Str
title Left substring
desc
Substring of *s* from the left.
oper len
func Len p0:Str -- Int
title Length of string
desc
Length of string in bytes.
oper local-zone
func LocalZone p0:Str --
title Sets the local time zone
desc
Sets the local time zone to *p0*.
oper local-zone=
func LocalZoneGet -- Str
title Gets the local time zone
desc
Gets the local time zone.
oper log10
func Log10Float p0:Float -- Float
title Decimal logarithm
desc
Decimal logarithm of *p0*.
oper log2
func Log2Float p0:Float -- Float
title Binary logarithm
desc
Binary logarithm of *p0*.
oper log
func LogFloat p0:Float -- Float
title Natural logarithm
desc
Natural logarithm of *p0*.
oper lower
func Lower p0:Str -- Str
title Lowercase
desc
Converts the string *p0* to lowercase.
oper lsh
func Lsh p0:BigInt n:Uint -- BigInt
alias left-shift
title Left shift bits
desc
Shifts all bits in *p0* to the left by *n*.
oper lt
func LtBigInt p0:BigInt p1:BigInt -- Bool
func LtDecimal p0:Decimal p1:Decimal -- Bool
func LtRational p0:Rational p1:Rational -- Bool
func LtFloat p0:Float p1:Float -- Bool
func LtStr p0:Str p1:Str -- Bool
alias less-than
title Less than
desc
`true` if *p0* is less than *p1*, otherwise `false`.
No description provided by the author
oper lte
func LteBigInt p0:BigInt p1:BigInt -- Bool
func LteDecimal p0:Decimal p1:Decimal -- Bool
func LteRational p0:Rational p1:Rational -- Bool
func LteFloat p0:Float p1:Float -- Bool
func LteStr p0:Str p1:Str -- Bool
alias less-than-or-equal
title Less than or equal
desc
`true` if *p0* is less than or equal to *p1*, otherwise `false`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
oper map
func Map Val* expr:Str -- Val*
title Apply a function to each item on the stack
desc
Apply expression *expr* to each value in the stack.
oper minutes
func Minutes p0:Duration -- Float
title Minutes in duration
desc
Converts the duration *p0* into minutes.
oper mod
func ModBigInt p0:BigInt p1:BigInt -- BigInt
func ModDecimal p0:Decimal p1:Decimal -- Decimal
func ModFloat p0:Float p1:Float -- Float
title Modulus
desc
The modulus when *p0* is divided by *p1*.
No description provided by the author
No description provided by the author
oper mul
func MulBigInt p0:BigInt p1:BigInt -- BigInt
func MulDecimal p0:Decimal p1:Decimal -- Decimal
func MulFloat p0:Float p1:Float -- Float
func MulRational p0:Rational p1:Rational -- Rational
func MulComplex p0:Complex p1:Complex -- Complex
alias m
alias *
title Multiplication
desc
Multiplies *p0* by *p1*.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
oper n
func N -- Int
title Number of stack items
desc
Number of items on the stack.
oper neg
func NegBigInt p0:BigInt -- BigInt
func NegDecimal p0:Decimal -- Decimal
func NegFloat p0:Float -- Float
func NegRational p0:Rational -- Rational
title Negation
desc
Changes the sign of `p0`.
No description provided by the author
No description provided by the author
No description provided by the author
oper neq
func NeqBigInt p0:BigInt p1:BigInt -- BigInt
func NeqDecimal p0:Decimal p1:Decimal -- Decimal
func NeqFloat p0:Float p1:Float -- Float
func NeqRational p0:Rational p1:Rational -- Rational
func NeqComplex p0:Complex p1:Complex -- Complex
func IsNot p0:Str p1:Str -- Str
title Not equal
desc
`true` if *p0* and *p1* are not equal, otherwise `false`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
oper not
func NotBigInt p0:BigInt -- BigInt
title Bitwise not
desc
The bitwise not of *p0*.
oper not
func NotBool Bool -- Bool
title Negation
desc
If `true`, returns `false`, otherwise returns `true`.
oper now
func Now -- DateTime
title Current date and time
desc
The current date and time.
oper now-restore
func NowRestore --
title Cancel now override
desc
Cancel override of the value returned by now.
oper now-set
func NowSet p0:DateTime --
title Override now value
desc
Override the value returned by `now`.
oper oct
func Oct a:BigInt -- dec:BigInt
title Octal conversion
desc
Convert the value of *p0* to an octal number.
oper or
func OrBigInt a:BigInt b:BigInt -- and:BigInt
title Bitwise or
desc
The bitwise or of *p0* and *p1*.
oper or
func OrBool p0:Bool p1:Bool -- Bool
title Logical disjunction
desc
The logical disjunction of *p0* and *p1*.
oper pow
func PowBigInt p0:BigInt p1:BigInt -- BigInt
func PowFloat p0:Float p1:Float -- Float
func PowComplex p0:Complex p1:Complex -- Complex
alias **
alias ^
title Exponentiation
desc
Raises *p0* to the power of *p1*.
No description provided by the author
No description provided by the author
oper rand
func Rand -- Float
title Random float
desc
Random number between 0 and 1.
oper rand-choice
func RandChoice ..
oper rand-int
func RandInt n:Int -- Int
title Random integer
desc
Random integer between 1 and *n*.
oper rand-seed
func RandSeed seed:Int64 --
title Set the random number seed
desc
Sets the random number seed to *seed*.
oper rand-seed=
func RandSeedGet -- Int64
title Get the random number seed
desc
Gets the random number seed.
oper rem
func RemBigInt p0:BigInt p1:BigInt -- BigInt
func RemFloat p0:Float p1:Float -- Float
title Remainder
desc
The remainder when *p0* is divided by *p1*.
No description provided by the author
oper repeat
func Repeat Val* expr:Str n:Int -- Val*
title Repeat the execution of a function
desc
Repeat execution of expression *expr* for *n* times.
oper reverse
func Reverse ..
oper rgb-cmyk
func RGBToCMYK r:Uint8 g:Uint8 b:Uint8 -- c:Uint8 m:Uint8 y:Uint8 k:Uint8
title RGB to CMYK color space
desc
Convert the RGB color *r*, *b*, *g* to the CMYK color space as *c*, *m*, *y*,
*k*.
No description provided by the author
oper right
func Right p0:Str n:Int -- Str
title Right substring
desc
Substring of *p0* from the right.
oper roll
func Roll dice:Str -- Int*
title Dice roller
desc
Rolls dice as specified by *dice* in standard dice notation.
oper rotate-13
func Rot13 p0:Str -- Str
alias rot13
title Rotate characters by 13
desc
Rotate all characters in string *p0* by 13.
oper round
func Round d:Decimal n:Int -- Decimal
alias r
title Round to a given precision
desc
Rounds the number *n* to *d* digits using the current rounding mode.
oper rounding-mode
func RoundingMode -- Str
title Set method to use in rounding
desc
Sets the mode to be used when rounding.
oper rounding-mode=
func RoundingModeGet -- Str
title Method to use in rounding
desc
Gets the current rounding mode
end
example
rounding-mode= -- half-up
end
*/.
oper rsh
func Rsh p0:BigInt n:Uint -- BigInt
alias right-shift
title Right shift bits
desc
Shifts all bits in *p0* to the right by *n*.
oper scientific-notation
func ScientificNotation p0:Float -- Float
alias sn
title Scientific notatoin
desc
Formats the value *p0* using scientific notation.
oper seconds
func Seconds p0:Duration -- Float
title Seconds in duration
desc
Converts the duration *p0* into seconds.
oper shuffle
func Shuffle ..
oper sign
func SignBigInt p0:BigInt -- Int
func SignDecimal p0:Decimal -- Int
func SignFloat p0:Float -- Int
func SignRational p0:Rational -- Int
title Sign
desc
Returns `-1` if *p0* is negative, `1` if *p0* is positive, or `0` if *p0*
is zero.
No description provided by the author
No description provided by the author
No description provided by the author
oper sin
func SinFloat p0:Float -- Float
title Sine
desc
Sine of *p0* in radians
end
example
2 sin -- 0.9092974268256816
end
*/.
oper sinh
func SinhFloat p0:Float -- Float
title Hyperbolic sine
desc
Hyperbolic sine of *p0* in radians.
oper split
func Split p0:Str sep:Str -- Str*
title Split string
desc
Split *p0* into multiple strings that are separated by *sep*.
No description provided by the author
oper sqrt
func SqrtFloat p0:Float -- Float
func - p0:Float -- Complex
func SqrtComplex p0:Complex -- Complex
alias square-root
title Square root
desc
The square root of `p0`.
oper sub
func SubBigInt p0:BigInt p1:BigInt -- BigInt
func SubDecimal p0:Decimal p1:Decimal -- Decimal
func SubFloat p0:Float p1:Float -- Float
func SubRational p0:Rational p1:Rational -- Rational
func SubComplex p0:Complex p1:Complex -- Complex
alias s
alias -
title Subtraction
desc
Subtract *p1* from *p0*.
No description provided by the author
No description provided by the author
No description provided by the author
oper sub
func SubDuration p0:Duration p1:Duration -- Duration
func SubDateTimeDuration p0:DateTime p1:Duration -- Duration
alias s
alias -
title Time or duration subtractoin
desc
Subtraces a duration from a time or subracts two durations.
No description provided by the author
No description provided by the author
oper swap
func Swap p0:Val p1:Val -- p1:Val p0:Val
title Swap top two items on the stack
desc
Swap the first two items on the stack.
oper take
func Take ..
oper tan
func TanFloat p0:Float -- Float
title Tangent
desc
Tangent of *p0* in radians
end
example
2 tan -- -2.185039863261519
end
*/.
oper tanh
func TanhFloat p0:Float -- Float
title Hyperbolic tangent
desc
Hyperbolic tangent of *p0* in radians.
oper time
func Time p0:DateTime -- Time
title Formats to a common time layout
desc
Formats a date/time with the common time layout.
oper timezone
func TimeZone p0:DateTime zone:Str -- DateTime
alias tz
title Convert time to another time zone
desc
Converts time *p0* to a given time *zone*.
oper up
func Up ..
oper upper
func Upper p0:Str -- Str
title Uppercase
desc
Convert string *p0* to uppercase.
oper utf8-decode
func UTF8Decode p0:BigInt -- Str
alias u8de
title Decode UTF-8 bytes
desc
Decode UTF-8 bytes in *p0* into to a string.
oper utf8-encode
func UTF8Encode p0:Str -- BigInt
alias u8en
title Encode UTF-8 bytes
desc
Encode a string into UTF-8 bytes.
oper version
func Version --
title Version number
desc
Version number of the calculator.
oper xor
func Xor a:BigInt b:BigInt -- and:BigInt
title Bitwise exclusive or
log.Panicf("the fields are: [%v]\n", fields[2])
desc
The bitwise exclusive or of `a` and `b`.
# Variables
No description provided by the author