ops

package
v0.0.0-...-fc8933c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const EarthRadius = 6371000

Variables

View Source
var Emoji = map[string]string{}/* 1870 elements not displayed */
View Source
var Entities = map[string]string{}/* 2089 elements not displayed */
View Source
var TimeZones = map[string]string{}/* 597 elements not displayed */

Functions

func AbsBigInt

func AbsBigInt(c zc.Calc)

oper abs func AbsBigInt p0:BigInt -- BigInt func AbsDecimal p0:Decimal -- Decimal func AbsFloat p0:Float -- Float func AbsRational p0:Rational -- Rational title Absolute value

desc If *p0* is less than zero, the negated value of *p0*, otherwise *p0*. end

example -6 -- -6 abs -- 6 end

func AbsComplex

func AbsComplex(c zc.Calc)

oper abs func AbsComplex p0:Complex -- Float title Distance from zero in complex plane

desc The distance of *p0* from zero in the complex plane. end

example 2+2i abs 5 round -- 2.82843 end

func AbsDecimal

func AbsDecimal(c zc.Calc)

func AbsFloat

func AbsFloat(c zc.Calc)

func AbsRational

func AbsRational(c zc.Calc)

func AcosComplex

func AcosComplex(c zc.Calc)

func AcosFloat

func AcosFloat(c zc.Calc)

oper acos func AcosFloat p0:Float -- Float title Inverse cosine

desc Inverse cosine of *p0* in radians. end

example 0.5 acos 5 round -- 1.0472 end

func AcoshComplex

func AcoshComplex(c zc.Calc)

oper acosh func AcoshComplex p0:Complex -- Complex title Inverse hyperbolic cosine

desc Inverse hyperbolic cosine of *p0* end

example 2+2i acosh 5 round -- 1.73432+0.81655i end

func AcoshFloat

func AcoshFloat(c zc.Calc)

oper acosh func AcoshFloat p0:Float -- Float title Inverse hyperbolic cosine

desc Inverse hyperbolic cosine of *p0* in radians. end

example 2 acosh 5 round -- 1.31696 end

func AddBigInt

func AddBigInt(c zc.Calc)

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*. end

example 6 -- 6 2 -- 6 | 2 a -- 8 end

func AddComplex

func AddComplex(c zc.Calc)

func AddDateTimeDuration

func AddDateTimeDuration(c zc.Calc)

func AddDecimal

func AddDecimal(c zc.Calc)

func AddDuration

func AddDuration(c zc.Calc)

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. end

example c 3:30pm -- 3:30pm 2h add -- Mon Jan 2 2006 5:30:00pm -0700 MST c 2h30m -- 2h30m 45m add -- 3h 15m end

func AddDurationDateTime

func AddDurationDateTime(c zc.Calc)

func AddFloat

func AddFloat(c zc.Calc)

func AddRational

func AddRational(c zc.Calc)

func AndBigInt

func AndBigInt(c zc.Calc)

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

func AndBool

func AndBool(c zc.Calc)

oper and func AndBool p0:Bool p1:Bool -- Bool title Logical conjunction

desc The logical conjunction of *p0* and *p1*. end

example c true true and -- true c true false and -- false c false false and -- false end

func Anno

func Anno(c zc.Calc)

oper anno func Anno p0:Val anno:Str -- p0:Val alias annotate title Annotate value

desc Annotate the value of *p0* with *anno*. end

example 42 -- 42 'the answer' anno -- 42 # the answer end

func AsinComplex

func AsinComplex(c zc.Calc)

oper asin func AsinComplex p0:Complex -- Complex title Inverse sine

desc Inverse sine of *p0*. end

example 0.5+2i asin 5 round -- 0.22102+1.46572i end

func AsinFloat

func AsinFloat(c zc.Calc)

oper asin func AsinFloat p0:Float -- Float title Inverse sine

desc Inverse sine of *p0* in radians. end

example 0.5 asin 5 round -- 0.5236 end

func AsinhComplex

func AsinhComplex(c zc.Calc)

oper asinh func AsinComplex p0:Complex -- Complex title Inverse hyperbolic sine

desc Inverse hyperbolic sine of *p0*. end

example 2+2i asinh 5 round -- 0.75425+1.73432i end

func AsinhFloat

func AsinhFloat(c zc.Calc)

oper asinh func AsinhFloat p0:Float -- Float title Inverse hyperbolic sine

desc Inverse hyperbolic sine of *p0* in radians. end

example 2 asinh 5 round -- 1.44364 end

func Atan2Float

func Atan2Float(c zc.Calc)

oper atan2 func Atan2Float p0:Float p1:Float -- Float title Inverse tangent

desc Inverse tangent of *p0*\/*p1*. end

example 1 2 atan2 5 round -- 0.46365 end

func AtanComplex

func AtanComplex(c zc.Calc)

oper atan func AtanComplex p0:Complex -- Complex title Inverse tangent

desc Inverse tangent of *p0*. end

example 0.5+2i atan 5 round -- 1.42155+0.50037i end

func AtanFloat

func AtanFloat(c zc.Calc)

oper atan func AtanFloat p0:Float -- Float title Inverse tangent

desc Inverse tangent of *p0* in radians. end

example 0.5 atan 5 round -- 0.46365 end

func AtanhComplex

func AtanhComplex(c zc.Calc)

oper atanh func AtanhComplex p0:Complex -- Complex title Inverse hyperbolic tangent

desc Inverse hyperbolic tangent of *p0*. end

example 0.5+2i atanh 5 round --0.09642+1.12656i end

func AtanhFloat

func AtanhFloat(c zc.Calc)

oper atanh func AtanhFloat p0:Float -- Float title Inverse hyperbolic tangent

desc Inverse hyperbolic tangent of *p0* in radians. end

example 0.5 atanh 5 round -- 0.54931 end

func Average

func Average(c zc.Calc)

oper average func Average BigInt* -- BigInt func - Decimal* -- Decimal func - Float* -- Float func - Rational* -- Rational func - Complex* -- Complex alias avg title Average

desc The average of all items on the stack. end

example 0 100 25 75 avg -- 50 end

func Bin

func Bin(c zc.Calc)

oper bin func Bin p0:BigInt -- BigInt title Binary conversion

desc Convert the value of *p0* to a binary number. end

example 0x0f -- 0x0f bin -- 0b1111 end

func Bit

func Bit(c zc.Calc)

oper bit func Bit p0:BigInt n:Int -- Uint title Bit value

desc The value of the *n*th bit of *p0*. end

example 0b100 -- 0b100 2 bit -- 1 end

func Bits

func Bits(c zc.Calc)

oper bits func Bits p0:BigInt -- Int title Length in bits

desc The length of *p0* in bits. end

example 0b11111 -- 0b11111 bits -- 5 end

func Bytes

func Bytes(c zc.Calc)

oper bytes func Bytes p0:BigInt -- Int title Length in bytes

desc The length of *p0* in bytes. end

example 0x1ff -- 0x1ff bytes -- 2 end

func CMYKToRGB

func CMYKToRGB(calc zc.Calc)

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*. end

example 0 127 191 127 -- 0 | 127 | 191 | 127 cmyk-rgb -- 128 | 64 | 32 end

func CeilDecimal

func CeilDecimal(c zc.Calc)

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*. end

example 6.12 -- 6.12 ceil -- 7 end

func CeilFloat

func CeilFloat(c zc.Calc)

func CharToCodePoint

func CharToCodePoint(c zc.Calc)

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. end

example [°] -- ° char-cp -- 176 hex -- 0xb0 end

func Clear

func Clear(c zc.Calc)

oper clear func Clear Val* -- alias c title Clear the stack

desc Remove all items from the stack. end

example 1 -- 1 2 -- 1 | 2 clear -- end

func CodePointToChar

func CodePointToChar(c zc.Calc)

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. end

example 0xb0 -- 0xb0 cp-char -- ° end

func Coeff

func Coeff(c zc.Calc)

oper coeff func Coeff p0:Decimal -- BigInt title Coefficient

desc The value of *p0* without the decimal point. end

example 12.345 coeff -- 12345 end

func ColorSample

func ColorSample(calc zc.Calc)

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*. The terminal in use must be able to support 24-bit ANSI color codes. end

func Complex

func Complex(c zc.Calc)

oper complex func Complex r:Float i:Float -- Complex title Complex from real and imaginary

desc A complex number from a real *r* and an imaginary *i* number. end

example 6 -- 6 12 -- 6 | 12 complex -- 6+12i end

func Conj

func Conj(c zc.Calc)

oper conj func Conj p0:Complex -- Complex title Complex conjugate

desc The complex conjugate of *p0* end

example 5+3i conj -- 5-3i end

func CosComplex

func CosComplex(c zc.Calc)

oper cos func CosComplex p0:Complex -- Complex title Cosine

desc Cosine of *p0*. end

example 2+2i cos 5 round -- -1.56563-3.29789i end

func CosFloat

func CosFloat(c zc.Calc)

oper cos func CosFloat p0:Float -- Float title Cosine

desc Cosine of *p0* in radians. end

example 2 cos 5 round -- -0.41615 end

func CoshComplex

func CoshComplex(c zc.Calc)

oper cosh func CoshComplex p0:Complex -- Complex title Hyperbolic cosine

desc Hyperbolic cosine of *p0*. end

example 2+2i cosh 5 round -- -1.56563+3.29789i end

func CoshFloat

func CoshFloat(c zc.Calc)

oper cosh func CoshFloat p0:Float -- Float title Hyperbolic cosine

desc Hyperbolic cosine of *p0* in radians. end

example 2 cosh 5 round -- 3.7622 end

func CotComplex

func CotComplex(c zc.Calc)

oper cot func CotComplex p0:Complex -- Complex title Cotangent

desc Cotangent of *p0*. end

example 2+3i cot 5 round -- -0.00374-0.99676i end

func DM

func DM(c zc.Calc)

oper deg-min func DM p0:DMS -- DMS alias dm title Angle in degrees and minutes

desc Reformat the angle *p0* to degrees and minutes end

example 10.1234 dm -- 10° 7.404′ end

func DMRound

func DMRound(c zc.Calc)

oper deg-min-round func DMRound p0:DMS n:Int32 -- DMS alias dmr title Rounded angle in degrees and minutes

desc Reformat the angle *p0* to degrees and minutes and round the minutes to *n* places. end

example 12.57611 3 dmr -- 12° 34.567′ end

func DMS

func DMS(c zc.Calc)

oper deg-min-sec func DMS p0:DMS -- DMS alias dms title Angle in degrees and minutes

desc Reformat the angle *p0* to degrees, minutes, and seconds. end

example -76.856944 dms -- -76° 51′ 24.9984″ end

func DMSRound

func DMSRound(c zc.Calc)

oper deg-min-sec-round func DMSRound p0:DMS n:Int32 -- DMS alias dmsr title Rounded angle in degrees, minutes, seconds

desc Reformat the angle *p0* to degrees, minutes, and seconds, and round the seconds to *n* places. end

example -76.856944 0 dmsr -- -76° 51′ 25″ end

func Date

func Date(c zc.Calc)

oper date func Date p0:DateTime -- Date title Formats to a common date layout

desc Formats date/time *p0* to a common date layout. Time information, if any, is removed. end

example '2006-01-02T15:04:05 UTC -- 2006-01-02T15:04:05 UTC date -- Mon Jan 2 2006 end

func DateTime

func DateTime(c zc.Calc)

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. end

example '2006-01-02T15:04:05 UTC -- 2006-01-02T15:04:05 UTC datetime -- Mon Jan 2 2006 3:04:05pm UTC end

func DayYear

func DayYear(c zc.Calc)

oper day-year func DayYear p0:DateTime -- Int alias doy title Day of year

desc Day of year for a given date *p0*. end

example 2006-03-15 -- 2006-03-15 day-year -- 74 end

func Dec

func Dec(c zc.Calc)

oper dec func Dec p0:Decimal -- Decimal func DecFloat p0:Float -- Decimal func DecRational p0:Rational -- Decimal title Decimal number

desc Pops *p0* from the stack and formats it as a `Decimal`. end

example 1e3 dec -- 1000 end

func DecBigInt

func DecBigInt(c zc.Calc)

oper dec func DecBigInt p0:BigInt -- BigInt title Decimal conversion

desc Convert the value of *p0* to a decimal number. end

example 0xf -- 0xf dec -- 15 end

func DecDMS

func DecDMS(c zc.Calc)

oper dec func DecDMS p0:DMS -- Decimal title DMS angle to decimal degrees

desc Convert the DMS angle *p0* to decimal degrees. end

example 10d7m24.24s dec -- 10.1234 end

func DecFloat

func DecFloat(c zc.Calc)

func DecRational

func DecRational(c zc.Calc)

func Denom

func Denom(c zc.Calc)

oper denom func Denom p0:Rational -- BigInt title Denominator

desc The denominator of rational number *p0*. end

example 2/3 denom -- 3 end

func DivComplex

func DivComplex(c zc.Calc)

func DivDecimal

func DivDecimal(c zc.Calc)

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*. If *p1* is zero, a 'division by zero' error is raised. end

example 6 -- 6 2 -- 6 | 2 d -- 3 end

func DivFloat

func DivFloat(c zc.Calc)

func DivRational

func DivRational(c zc.Calc)

func DivRem

func DivRem(c zc.Calc)

oper div-rem func DivRem p0:Decimal p1:Decimal -- r:Decimal q:Decimal alias dr title Division with remainder

desc Divides *p0* by *p1* and returns the quotient *q* and remainder *r*. end

example 1234 100 div-rem -- 34 | 12 end

func Down

func Down(c zc.Calc)

oper down func Down Val* -- Val* alias dn title Rotate stack downward

desc Rotate items on the stack by moving downward.

In the interactive calculator, the top of the stack is towards the bottom of the terminal so downward means seeing all items moves toward the bottom. The top of the stack wraps around to be the bottom of the stack. end

example 1 2 3 -- 1 | 2 | 3 down -- 3 | 1 | 2 down -- 2 | 3 | 1 end

func Drop

func Drop(c zc.Calc)

oper drop func Drop Val -- title Drop top item from stack

desc Remove the top item from the stack. end

example 1 -- 1 2 -- 1 | 2 drop -- 1 end

func Dup

func Dup(c zc.Calc)

oper dup func Dup p0:Val -- p0:Val p0:Val title Duplicate top stack item

desc Duplicate the top item on the stack. end

example 1 -- 1 dup -- 1 | 1 end

func EarthRadiusFn

func EarthRadiusFn(c zc.Calc)

oper earth-radius func EarthRadiusFn -- Int title Average radius of the Earth

desc The globally-average value of the Earth in meters.

Source: https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html end

example earth-radius -- 6371000 # meters end

func EqBigInt

func EqBigInt(c zc.Calc)

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`. end

example c 1234.56 1,234.56 eq -- true c 1234.56 1234.56000 eq -- true c 1234.56 $1,234.56 eq -- true c 1234.56 +1,234.56 eq -- true end

func EqComplex

func EqComplex(c zc.Calc)

func EqDecimal

func EqDecimal(c zc.Calc)

func EqFloat

func EqFloat(c zc.Calc)

func EqRational

func EqRational(c zc.Calc)

func Eval

func Eval(c zc.Calc)

oper eval func Eval expr:Str -- Val* title Evaluate top of stack

desc Evaluate *expr* as if it was input to the calculator. end

example [1 2 add -- 1 2 add eval -- 3 end

func ExpComplex

func ExpComplex(c zc.Calc)

oper exp func ExpComplex p0:Complex -- Complex title Natural exponential

desc Natural exponential of *p0*. end

example 2+2i exp 5 round -- -3.07493+6.71885i end

func ExpFloat

func ExpFloat(c zc.Calc)

oper exp func ExpFloat p0:Float -- Float title Natural exponential

desc Natural exponential of *p0*. end

example 2 exp 5 round -- 7.38906 end

func Filter

func Filter(c zc.Calc)

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*. end

example 1 2 3 4 5 6 -- 1 | 2 | 3 | 4 | 5 | 6 [2 mod 0 eq] filter -- 2 | 4 | 6 end

func FloorDecimal

func FloorDecimal(c zc.Calc)

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*. end

example 6.12 -- 6.12 floor -- 6 end

func FloorFloat

func FloorFloat(c zc.Calc)

func Fold

func Fold(c zc.Calc)

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*. An 'invalid function' error is raised if *expr* does not reduce. end

example 1 2 3 4 5 -- 1 | 2 | 3 | 4 | 5 [add] fold -- 15 end

func GtBigInt

func GtBigInt(c zc.Calc)

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`. end

example c 1 0 gt -- true c 0 0 gt -- false c -1 0 gt -- false end

func GtDecimal

func GtDecimal(c zc.Calc)

func GtFloat

func GtFloat(c zc.Calc)

func GtRational

func GtRational(c zc.Calc)

func GtStr

func GtStr(c zc.Calc)

func GteBigInt

func GteBigInt(c zc.Calc)

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`. end

example c 1 0 gte -- true c 0 0 gte -- true c -1 0 gte -- false end

func GteDecimal

func GteDecimal(c zc.Calc)

func GteFloat

func GteFloat(c zc.Calc)

func GteRational

func GteRational(c zc.Calc)

func GteStr

func GteStr(c zc.Calc)

func HSLToRGB

func HSLToRGB(calc zc.Calc)

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*. end

example 20 0.6 0.314 -- 20 | 0.6 | 0.314 hsl-rgb -- 128 | 64 | 32 end

func Haversine

func Haversine(c zc.Calc)

oper haversine func Haversine lat0:DMS lon0:DMS lat1:DMS lon1:DMS -- Float title Great circle distance between two points

desc Calculates the great circle distance between (*lat0*, *lon0*) and (*lat1*, *lon1*) using the haversine formula.

Source: https://community.esri.com/t5/coordinate-reference-systems-blog/distance-on-a-sphere-the-haversine-formula/ba-p/902128 end

example 51.510357 -0.116773 -- 51.510357 | -0.116773 38.889931 -77.009003 -- 51.510357 | -0.116773 | 38.889931 | -77.009003 haversine 3 round dec -- 5897658.289 end

func HexBigInt

func HexBigInt(c zc.Calc)

oper hex func HexBigInt p0:BigInt -- BigInt title Hexadecimal conversion

desc Convert the value of *p0* to a hexadecimal number. end

example 0b1111 -- 0b1111 hex -- 0xf end

func Hours

func Hours(c zc.Calc)

oper hours func Hours p0:Duration -- Float title Hours in duration

desc Converts the duration *p0* into hours. end

example 10h20m30s -- 10h20m30s hours 2 round -- 10.34 end

func Imag

func Imag(c zc.Calc)

oper imag func Imag p0:Complex -- Float title Imaginary number from complex

desc The imaginary number part of complex number *p0* end

example 3+4i imag -- 4 end

func Int

func Int(c zc.Calc)

func Inv

func Inv(c zc.Calc)

oper inv func Inv p0:Rational -- Rational title Inverse

desc Returns the inverse which is 1/*p0*. end

example 1/2 inv -- 2 end

func Is

func Is(c zc.Calc)

oper is func Is p0:Str p1:Str -- Bool title Byte equality

desc `true` if *p0* and *p1* are the same, byte by byte. end

example c 1.2 1.20 is -- false c 1.2 1.2 is -- true end

func IsDMS

func IsDMS(c zc.Calc)

oper is-dms func IsDMS p0:Str -- Bool alias is-dec-min-sec title Checks value can be parsed as degree, minutes, seconds

desc Returns `true` if the value *p0* can be parsed as an angle with degrees, minutes, and seconds. end

example c [10° 30′ 45″] is-dms -- true c [10 30 45 ] is-dms -- false end

func IsDateTime

func IsDateTime(c zc.Calc)

oper is-datetime func IsDateTime p0:Str -- Bool alias is-dt title Checks value can be parsed as a `DateTime`

desc Returns `true` if the value *p0* can be parsed as a DateTime. end

example c [2 May 2023] is-datetime -- true c [2 Nay 2023] is-datetime -- false end

func IsNot

func IsNot(c zc.Calc)

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. end

example c 1.2 1.20 is-not -- true c 1.2 1.2 is-not -- false end

func IsRational

func IsRational(c zc.Calc)

oper is-rational func IsRational p0:Str -- Bool title Checks value can be parsed as a rational

desc Returns `true` if the value *p0* can be parsed as a Rational. end

example c 1/2 is-rational -- true c 1+2i is-rational -- false end

func Join

func Join(c zc.Calc)

oper join func Join Val* sep:Str -- Str title Join stack elements

desc Join all stack elements into a single string separated by *sep*. end

example 128 8 74 2 -- 128 | 8 | 74 | 2 '.' join -- 128.8.74.2 end

func Left

func Left(c zc.Calc)

oper left func Left p0:Str n:Int -- Str title Left substring

desc Substring of *s* from the left.

If *n* is positive, *m* characters are taken from the left. If *n* is negative, characters are taken from the left until there are *n* characters remaining. If *n* is zero, *s* is returned without change.

If the absolute value of *n* is greater then then length of *s*, an 'illegal arguments' error is raised. end

example 'abcdef -- abcdef 4 left -- abcd -1 left -- abc end

func Len

func Len(c zc.Calc)

oper len func Len p0:Str -- Int title Length of text in characters

desc Length of text in characters. end

example c 'abcd' len -- 4 c '🥇🥈🥉👏' len -- 4 end

func LocalZone

func LocalZone(c zc.Calc)

oper local-zone func LocalZone p0:Str -- title Sets the local time zone

desc Sets the local time zone to *p0*. end

exammple now time -- 3:04:05pm -0700 MST c [est] local-zone -- *local time zone is now 'EST'* now time -- 5:04:05pm -0500 EST c Asia/Jakarta local-zone -- *local time zone is now 'Asia/Jakarta'* now time -- 5:04:05am +0700 end

func LocalZoneGet

func LocalZoneGet(c zc.Calc)

oper local-zone= func LocalZoneGet -- Str title Gets the local time zone

desc Gets the local time zone. end

example local-zone= -- MST end

func Log10Complex

func Log10Complex(c zc.Calc)

oper log10 func Log10Complex p0:Complex -- Complex title Decimal logarithm

desc Decimal logarithm of *p0*. end

example 50+20i log10 5 round -- 1.7312+0.16525i end

func Log10Float

func Log10Float(c zc.Calc)

oper log10 func Log10Float p0:Float -- Float title Decimal logarithm

desc Decimal logarithm of *p0*. end

example 50 log10 5 round -- 1.69897 end

func Log2Float

func Log2Float(c zc.Calc)

oper log2 func Log2Float p0:Float -- Float title Binary logarithm

desc Binary logarithm of *p0*. end

example 250 log2 5 round -- 7.96578 end

func LogComplex

func LogComplex(c zc.Calc)

oper log func LogComplex p0:Complex -- Complex title Natural logarithm

desc Natural logarithm of *p0*. end

example 8+2i log 5 round -- 2.10975+0.24498i end

func LogFloat

func LogFloat(c zc.Calc)

oper log func LogFloat p0:Float -- Float title Natural logarithm

desc Natural logarithm of *p0*. end

example 8 log 5 round -- 2.07944 end

func Lower

func Lower(c zc.Calc)

oper lower func Lower p0:Str -- Str title Lowercase

desc Converts the string *p0* to lowercase. end

example 'AbCd -- AbCd lower -- abcd end

func Lsh

func Lsh(c zc.Calc)

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*. end

example 0b10 -- 0b10 2 lsh bin -- 0b1000 end

func LtBigInt

func LtBigInt(c zc.Calc)

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`. end

example c 1 0 lt -- false c 0 0 lt -- false c -1 0 lt -- true end

func LtDecimal

func LtDecimal(c zc.Calc)

func LtFloat

func LtFloat(c zc.Calc)

func LtRational

func LtRational(c zc.Calc)

func LtStr

func LtStr(c zc.Calc)

func LteBigInt

func LteBigInt(c zc.Calc)

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`. end

example c 1 0 lte -- false c 0 0 lte -- true c -1 0 lte -- true end

func LteDecimal

func LteDecimal(c zc.Calc)

func LteFloat

func LteFloat(c zc.Calc)

func LteRational

func LteRational(c zc.Calc)

func LteStr

func LteStr(c zc.Calc)

func Map

func Map(c zc.Calc)

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. end

example 1 2 3 4 5 -- 1 | 2 | 3 | 4 | 5 [2 mul] map -- 2 | 4 | 6 | 8 | 10 end

func Minutes

func Minutes(c zc.Calc)

oper minutes func Minutes p0:Duration -- Float title Minutes in duration

desc Converts the duration *p0* into minutes. end

example 10h20m30s -- 10h20m30s minutes 2 round -- 620.5 end

func MinutesDMS

func MinutesDMS(c zc.Calc)

oper minutes func MinutesDMS p0:DMS -- Decimal title Angle in minutes

desc Converts the angle *p0* to minutes. end

example 10d30m minutes -- 630 end

func ModBigInt

func ModBigInt(c zc.Calc)

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*. If *p1* is zero, a 'division by zero' error is raised. end

example -7 2 mod -- 1 end

func ModDecimal

func ModDecimal(c zc.Calc)

func ModFloat

func ModFloat(c zc.Calc)

func MulBigInt

func MulBigInt(c zc.Calc)

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*. end

example 6 -- 6 2 -- 6 | 2 m -- 12 end

func MulComplex

func MulComplex(c zc.Calc)

func MulDecimal

func MulDecimal(c zc.Calc)

func MulFloat

func MulFloat(c zc.Calc)

func MulRational

func MulRational(c zc.Calc)

func N

func N(c zc.Calc)

oper n func N -- Int title Number of stack items

desc Number of items on the stack. end

example 1 1 1 1 -- 1 | 1 | 1 | 1 n -- 1 | 1 | 1 | 1 | 4 end

func NegBigInt

func NegBigInt(c zc.Calc)

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`. end

example -6 -- -6 neg -- 6 neg -- -6 end

func NegDecimal

func NegDecimal(c zc.Calc)

func NegFloat

func NegFloat(c zc.Calc)

func NegRational

func NegRational(c zc.Calc)

func NeqBigInt

func NeqBigInt(c zc.Calc)

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`. end

example c 123 123 neq -- false c 123 456 neq -- true end

func NeqComplex

func NeqComplex(c zc.Calc)

func NeqDecimal

func NeqDecimal(c zc.Calc)

func NeqFloat

func NeqFloat(c zc.Calc)

func NeqRational

func NeqRational(c zc.Calc)

func NoAnno

func NoAnno(c zc.Calc)

oper no-anno func NoAnno p0:Val -- p0:Val alias noa alias no-annotation title Remove annotation

desc Remove the annotation, if any, from *p0*. end

example 42 -- 42 'the answer' anno -- 42 # the answer noa -- 42 end

func NotBigInt

func NotBigInt(c zc.Calc)

oper not func NotBigInt p0:BigInt -- BigInt title Bitwise not

desc The bitwise not of *p0*. end

example 0b101 -- 0b101 not bin -- -0b110 end

func NotBool

func NotBool(c zc.Calc)

oper not func NotBool Bool -- Bool title Negation

desc If `true`, returns `false`, otherwise returns `true`. end

example true not -- false not -- true end

func Now

func Now(c zc.Calc)

oper now func Now -- DateTime title Current date and time

desc The current date and time. If `now-set` has been called, that date and time will be returned instead. end

example now -- Mon Jan 2 2006 3:04:05pm -0700 MST end

func NowRestore

func NowRestore(c zc.Calc)

oper now-restore func NowRestore -- title Cancel now override

desc Cancel override of the value returned by now. end

func NowSet

func NowSet(c zc.Calc)

oper now-set func NowSet p0:DateTime -- title Override now value

desc Override the value returned by `now`. Useful for to mocking current time while testing. end

example 'Nov 5 1955 01:22 -- Nov 5 1955 01:22 now-set -- *now set to 'Sat Nov 5 1955 1:22:00am -0700 MST'* now -- Sat Nov 5 1955 1:22:00am -0700 MST end

func Num

func Num(c zc.Calc)

oper num func Num p0:Rational -- BigInt title Numerator

desc The numerator of rational number *p0*. end

example 2/3 num -- 2 end

func Oct

func Oct(c zc.Calc)

oper oct func Oct p0:BigInt -- BigInt title Octal conversion

desc Convert the value of *p0* to an octal number. end

example 0b1111 -- 0b1111 oct -- 0o17 end

func OrBigInt

func OrBigInt(c zc.Calc)

oper or func OrBigInt p0:BigInt p1:BigInt -- BigInt title Bitwise or

desc The bitwise or of *p0* and *p1*. end

example 0b1100 -- 0b1100 0b1010 -- 0b1100 | 0b1010 or bin -- 0b1110 end

func OrBool

func OrBool(c zc.Calc)

oper or func OrBool p0:Bool p1:Bool -- Bool title Logical disjunction

desc The logical disjunction of *p0* and *p1*. end

example c true true or -- true c true false or -- true c false false or -- false end

func PhaseComplex

func PhaseComplex(c zc.Calc)

func PolarComplex

func PolarComplex(c zc.Calc)

oper polar func PolarComplex p0:Complex -- r:Float θ:Float title Complex to polar

desc The absolute value *r* and phase *θ* of *p0*. end

example 2i polar pi div 1 round -- 2 | 0.5 end

func PowBigInt

func PowBigInt(c zc.Calc)

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*. end

example 6 -- 6 2 -- 6 | 2 pow -- 36 end

func PowComplex

func PowComplex(c zc.Calc)

func PowFloat

func PowFloat(c zc.Calc)

func Proj

func Proj(c zc.Calc)

oper proj func Proj p0:Float p1:Float s:Str t:Str -- Float Float title Transform coordinate

desc Transform coordinate (*p0*, *p1*) in coordinate system *s* to a coordinate in system *t*. The order of the coordinates is defined by the coordinate system and it may be (lat, lon) or (x, y). end

example 39.203611 -76.856944 -- 39.203611 | -76.856944 epsg.wgs-84 18n epsg.utm -- 39.203611 | -76.856944 | EPSG:4326 | EPSG:32618 proj -- 339660.12559342897 | 4.341014551927999e06 end

func QuoRem

func QuoRem(c zc.Calc)

oper quo-rem func QuoRem p0:Decimal p1:Decimal prec:Int32 -- r:Decimal q:Decimal title Division with remainder at a precision

desc Divides *p0* by *p1* and returns the quotient *q* and remainder *r* at a certain precision. The following shows how to divide one dollar with three people which gives a quotient of $0.33 and a remainder of one cent. end

example $1.00 3 2 quo-rem -- 0.01 | 0.33 end

func RGBToCMYK

func RGBToCMYK(calc zc.Calc)

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*. end

example 128 64 32 -- 128 | 64 | 32 rgb-cmyk -- 0 | 127 | 191 | 127 end

func RGBToHSL

func RGBToHSL(calc zc.Calc)

func Rand

func Rand(c zc.Calc)

oper rand func Rand -- Float title Random float

desc Random number between 0 and 1. end

example 0 rand-seed -- *seed set to 0* rand -- 0.9451961492941164 end

func RandChoice

func RandChoice(c zc.Calc)

oper rand-choice func RandChoice ... a0:Val ... -- a0:Val title Randomly select item on stack

desc Randomly select an item on the stack. end

example 2 rand-seed -- *seed set to 2* 1 2 3 4 5 6 -- 1 | 2 | 3 | 4 | 5 | 6 rand-choice -- 5 end

func RandInt

func RandInt(c zc.Calc)

oper rand-int func RandInt n:Int -- Int title Random integer

desc Random integer between 1 and *n*. end

example 0 rand-seed -- *seed set to 0* 10 rand-int -- 5 end

func RandSeed

func RandSeed(c zc.Calc)

oper rand-seed func RandSeed seed:Int64 -- title Set the random number seed

desc Sets the random number *seed*. end

example 1 rand-seed -- *seed set to 1* 10 rand-int -- 2 end

func RandSeedGet

func RandSeedGet(c zc.Calc)

oper rand-seed= func RandSeedGet -- Int64 title Get the random number seed

desc Gets the random number seed. end

example 3 rand-seed -- *seed set to 3* rand-seed= -- 3 end

func RationalBigInt

func RationalBigInt(c zc.Calc)

func RationalFloat

func RationalFloat(c zc.Calc)

func Real

func Real(c zc.Calc)

oper real func Real p0:Complex -- Float title Real number from complex

desc The real number part of complex number *p0* end

example 3+4i real -- 3 end

func RectComplex

func RectComplex(c zc.Calc)

oper rect func RectComplex r:Float θ:Float -- Complex title Polar to complex

desc The complex number with polar coordinates *r* and *θ*. end

example 2 0.5 pi mul rect imag -- 2 end

func RemBigInt

func RemBigInt(c zc.Calc)

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*. If *p1* is zero, a 'division by zero' error is raised. end

example -7 -- -7 2 -- -7 | 2 rem -- -1 end

func RemFloat

func RemFloat(c zc.Calc)

func Repeat

func Repeat(c zc.Calc)

oper repeat func Repeat expr:Val n:Int -- Val* title Repeat the execution of a function

desc Repeat execution of expression *expr* for *n* times. end

example 1 -- 1 [2 mul] 8 repeat -- 256 end

func Reverse

func Reverse(c zc.Calc)

oper reverse func Reverse Val* -- Val* alias rev title Reverse stack

desc Reverses the elements on the stack. end

example 1 2 3 4 5 -- 1 | 2 | 3 | 4 | 5 reverse -- 5 | 4 | 3 | 2 | 1 end

func Right(c zc.Calc)

oper right func Right p0:Str n:Int -- Str title Right substring

desc Substring of *p0* from the right.

If *n* is positive, *n* characters are taken from the right. If *n* is negative, characters are taken from the right until there are *n* characters remaining. If *n* is zero, *s* is returned without change.

If the absolute value of *n* is greater then then length of *s*, an 'illegal arguments' error is raised. end

example 'abcdef -- abcdef 4 right -- cdef -1 right -- def end

func Roll

func Roll(c zc.Calc)

oper roll func Roll dice:Str -- Int* title Dice roller

desc Rolls dice as specified by *dice* in standard dice notation. The argument *dice* may start with the number of dice to roll, followed by the literal character `d`, and then the number of faces found on each die. For example, use `3d6` to roll three six sided dice. end

example 99 rand-seed -- *seed set to 99* 3d6 roll -- 6 | 2 | 1 sum -- 9 end

func Rot13

func Rot13(c zc.Calc)

oper rotate-13 func Rot13 p0:Str -- Str alias rot13 title Rotate characters by 13

desc Rotate all characters in string *p0* by 13. end

example 'Behind the tree! -- Behind the tree! rot13 -- Oruvaq gur gerr! rot13 -- Behind the tree! end

func RoundComplex

func RoundComplex(c zc.Calc)

oper round func RoundComplex p0:Complex n:Int -- Complex alias r title Round to a given precision

desc Rounds the real and imaginary numbers of *p0* to *n* digits using the half up rounding mode. end

example 1.047197551196598+5.948293i 3 round -- 1.047+5.948i end

func RoundDecimal

func RoundDecimal(c zc.Calc)

oper round func RoundDecimal d:Decimal n:Int -- Decimal func RoundFloat d:Float n:Int -- Float alias r title Round to a given precision

desc Rounds the number *n* to *d* digits using the current rounding mode. end

example 2 3 div -- 0.6666666666666666666 2 round -- 0.67 end

func RoundFloat

func RoundFloat(c zc.Calc)

func RoundingMode

func RoundingMode(c zc.Calc)

oper rounding-mode func RoundingMode -- Str title Set method to use in rounding

desc Sets the mode to be used when rounding. Valid modes are:

- `half-up` - `ceil` - `down` - `floor` - `half-even` - `up`

end

example 1.01 0.05 mul -- 0.0505 2 round -- 0.05 'up' rounding-mode -- *rounding-mode set to 'up'* c 1.01 0.05 mul -- 0.0505 2 round -- 0.06 end

func RoundingModeGet

func RoundingModeGet(c zc.Calc)

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

func Rsh

func Rsh(c zc.Calc)

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*. end

example 0b1000 -- 0b1000 2 rsh bin -- 0b10 end

func ScientificNotation

func ScientificNotation(c zc.Calc)

oper scientific-notation func ScientificNotation p0:Float -- Float alias sn title Scientific notatoin

desc Formats the value *p0* using scientific notation. end

example 1234 sn -- 1.234e03 end

func Seconds

func Seconds(c zc.Calc)

oper seconds func Seconds p0:Duration -- Float title Seconds in duration

desc Converts the duration *p0* into seconds. end

example 10h20m30s -- 10h20m30s seconds -- 37230 end

func SecondsDMS

func SecondsDMS(c zc.Calc)

oper seconds func SecondsDMS p0:DMS -- Decimal title Angle in seconds

desc Converts the angle *p0* to seconds. end

example 10d30m seconds -- 37800 end

func Shuffle

func Shuffle(c zc.Calc)

oper shuffle func Shuffle Val* -- Val* title Shuffle the stack

desc Shuffle the stack. end

example 0 rand-seed -- *seed set to 0* 1 2 3 4 5 6 -- 1 | 2 | 3 | 4 | 5 | 6 shuffle -- 5 | 4 | 1 | 3 | 2 | 6 end

func SignBigInt

func SignBigInt(c zc.Calc)

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. end

example c -6 sign -- -1 c 6 sign -- 1 c 0 sign -- 0 end

func SignDecimal

func SignDecimal(c zc.Calc)

func SignFloat

func SignFloat(c zc.Calc)

func SignRational

func SignRational(c zc.Calc)

func SinComplex

func SinComplex(c zc.Calc)

oper sin func SinComplex p0:Complex -- Complex title Sine

desc Sine of *p0*. end

example 2+2i sin 5 round -- 3.42095-1.50931i end

func SinFloat

func SinFloat(c zc.Calc)

oper sin func SinFloat p0:Float -- Float title Sine

desc Sine of *p0* in radians. end

example 2 sin 5 round -- 0.9093 end

func SinhComplex

func SinhComplex(c zc.Calc)

oper sinh func SinhComplex p0:Complex -- Complex title Hyperbolic sine

desc Hyperbolic sine of *p0*. end

example 2+2i sinh 5 round -- -1.50931+3.42095i end

func SinhFloat

func SinhFloat(c zc.Calc)

oper sinh func SinhFloat p0:Float -- Float title Hyperbolic sine

desc Hyperbolic sine of *p0* in radians. end

example 2 sinh 5 round -- 3.62686 end

func Split

func Split(c zc.Calc)

oper split func Split p0:Str sep:Str -- Str* title Split string

desc Split *p0* into multiple strings that are separated by *sep*. end

example 128.8.74.2 -- 128.8.74.2 '.' split -- 128 | 8 | 74 | 2 end

func SqrtComplex

func SqrtComplex(c zc.Calc)

func SqrtFloat

func SqrtFloat(c zc.Calc)

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*. If *p0* is a positive or zero then a Float is returned. If *p0* is negative, a Complex is returned. end

example 256 -- 256 sqrt -- 16 end

func SubBigInt

func SubBigInt(c zc.Calc)

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*. end

example 6 -- 6 2 -- 6 | 2 s -- 4 end

func SubComplex

func SubComplex(c zc.Calc)

func SubDateTime

func SubDateTime(c zc.Calc)

func SubDateTimeDuration

func SubDateTimeDuration(c zc.Calc)

func SubDecimal

func SubDecimal(c zc.Calc)

func SubDuration

func SubDuration(c zc.Calc)

oper sub func SubDuration p0:Duration p1:Duration -- Duration func SubDateTimeDuration p0:DateTime p1:Duration -- Duration func SubDateTime p0:DateTime p1:DateTime -- Duration alias s alias - title Time or duration subtraction desc Subtracts a duration from a time or subtracts two durations. end

example c 3:30pm 2h sub -- Mon Jan 2 2006 1:30:00pm -0700 MST c 2h30m 45m sub -- 1h 45m c 3:30pm 1:30pm sub -- 2h end

func SubFloat

func SubFloat(c zc.Calc)

func SubRational

func SubRational(c zc.Calc)

func Swap

func Swap(c zc.Calc)

oper swap func Swap p0:Val p1:Val -- p1:Val p0:Val alias sw title Swap top two items on the stack

desc Swap the first two items on the stack. end

example 1 2 -- 1 | 2 swap -- 2 | 1 swap -- 1 | 2 end

func Take

func Take(c zc.Calc)

oper take func Take Val* n:Int -- Val* title Take elements from the stack

desc Take the top *n* elements from the stack and discard the rest. end

example 1 2 3 4 5 -- 1 | 2 | 3 | 4 | 5 2 take -- 4 | 5 end

func TanComplex

func TanComplex(c zc.Calc)

oper tan func TanComplex p0:Complex -- Complex title Tangent

desc Tangent of *p0*. end

example 2+2i tan 5 round -- -0.02839+1.02384i end

func TanFloat

func TanFloat(c zc.Calc)

oper tan func TanFloat p0:Float -- Float title Tangent

desc Tangent of *p0* in radians. end

example 2 tan 5 round -- -2.18504 end

func TanhComplex

func TanhComplex(c zc.Calc)

oper tanh func TanhComplex p0:Complex -- Complex title Hyperbolic tangent

desc Hyperbolic tangent of *p0*. end

example 2+2i tanh 5 round -- 1.02384-0.02839i end

func TanhFloat

func TanhFloat(c zc.Calc)

oper tanh func TanhFloat p0:Float -- Float title Hyperbolic tangent

desc Hyperbolic tangent of *p0* in radians. end

example 2 tanh 5 round -- 0.96403 end

func Time

func Time(c zc.Calc)

oper time func Time p0:DateTime -- Time title Formats to a common time layout

desc Formats a date/time with the common time layout. Date information, if any, is discarded. end

example '2006-01-02T15:04:05 UTC -- 2006-01-02T15:04:05 UTC time -- 3:04:05pm UTC end

func TimeZone

func TimeZone(c zc.Calc)

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*. end

example now -- Mon Jan 2 2006 3:04:05pm -0700 MST [PST] tz -- Mon Jan 2 2006 2:04:05pm -0800 PST Asia/Jakarta tz -- Tue Jan 3 2006 5:04:05am +0700 WIB end

func Tone

func Tone(c zc.Calc)

oper tone func Tone p0:Str tone:Int -- Str title Apply a skin tone to an emoji

desc Apply a skin *tone*, an integer between 1 and 5 inclusive, to the first character in *p0* which should be an emoji that supports a skin tone. end

example :waving-hand: -- 👋 2 tone -- 👋🏽 end

func UTF8Decode

func UTF8Decode(c zc.Calc)

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. end

example 0x3534c2b0 -- 0x3534c2b0 utf8-decode -- 54° end

func UTF8Encode

func UTF8Encode(c zc.Calc)

oper utf8-encode func UTF8Encode p0:Str -- BigInt alias u8en title Encode UTF-8 bytes

desc Encode a string into UTF-8 bytes. end

example 54° -- 54° utf8-encode hex -- 0x3534c2b0 end

func UTM

func UTM(c zc.Calc)

oper epsg.utm func UTM p0:Str -- Str title Universal Transverse Mercator (WGS-84)

desc The EPGS code for the given UTM zone *p0*. The zone should be a number between 1 and 60 inclusive and is followed by a hemisphere designator of 'n' or 's'. end

example 17n epsg.utm -- EPSG:32617 end

func Up

func Up(c zc.Calc)

oper up func Up Val* -- Val* title Rotate items upward

desc Rotate items on the stack by moving upward.

In the interactive calculator, the top of the stack is towards the bottom of the terminal so upwards means seeing all items move toward the top. The bottom of the stack wraps around to be the top of the stack. end

example 1 2 3 -- 1 | 2 | 3 up -- 2 | 3 | 1 up -- 3 | 1 | 2 end

func Upper

func Upper(c zc.Calc)

oper upper func Upper p0:Str -- Str title Uppercase

desc Convert string *p0* to uppercase. end

example 'AbCd -- AbCd upper -- ABCD end

func Version

func Version(c zc.Calc)

oper version func Version -- title Version number

desc Version number of the calculator. end

func Xor

func Xor(c zc.Calc)

oper xor func Xor p0:BigInt p1:BigInt -- BigInt title Bitwise exclusive or

desc The bitwise exclusive or of `p0` and `p1`. end

example 0b1100 -- 0b1100 0b1010 -- 0b1100 | 0b1010 xor bin -- 0b110 end

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL