3b: Floating Point
+fn
Float.
A mold for the floating-point arithmetic using the base of two, the formula is .
Produces either a float (%f), an infinity of other sign (%i), or not-a-number (%n). .s refers to sign, the $flags & or |; .e to exponent, a signed decimal; and .a to the significand, an unsigned integer.
Source
++ fn
$% [%f s=? e=@s a=@u]
[%i s=?]
[%n ~]
==Examples
> *fn
[%n ~]> (add:fl [%f & --33 2] [%f | --23 2])
[%f s=%.y e=-79 a=10.374.452.512.267.829.421.849.019.032.797.184]> (add:fl [%i &] [%i &])
[%i s=%.y]+dn
Decimal float.
A mold for the floating-point arithmetic using the base of 10; the formula is .
Valid values are a float (%d), an infinity (%i), or a not-a-number (%n). .s refers to sign, the $flags & or |; .e to exponent, a signed decimal; and .a to the significand, an unsigned integer.
Examples
+rn
Parsed decimal float.
A mold for the floating-point arithmetic using the base of 10; the formula is .
Produces either a parsed float (%d), infinity of either sign (%i), or not-a-number (%n).
Source
Examples
+fl
Arbitrary-precision floating-point.
Container arm for floating-point arithmetic functions.
Precision (
.p): number of bits in the significand; must be at least 2. Default is113.Minimum exponent (
.v): minimum value of.e. Default is-16.494.Width (
.w): Max. value of.eminus min. value of.e.0is for fixed-point. Default is32.765.Rounding mode (
.r): Possible modes are nearest (%n), up (%u), down (%d), to zero (%z), and away from zero (%a). Default value is%n.Behavior (
.d): return denormals (%d), flush denormals to zero (%z), infinite exponent range (%i). Default value is%d.
Source
^rou:fl
Round.
Rounds .a to a the nearest float that can be represented with a 113-bit significand. There is no term to sign the significand, meaning that a positive sign will always be produced.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
An fn.
Source
Examples
+rau:fl
Various roundings.
Rounds .a based on what the state of of .r in the core contained in +fl. .t is a sticky bit that represents a value less than when passed to +lug:fl.
Accepts
.a is a cell of a signed integer and an unsigned integer.
.t is a $flag.
Produces
An +fn.
Source
Examples
Discussion
See +lug:fl for possible rounding operations.
^add:fl
Add.
Produces the sum of .a and .b. .e is used to choose between an exact result (any-sized significand) or a rounded result (113-bit significand).
There is no term to sign the significands, so a positive sign will always be produced.
Accepts
.a is an +fn.
.b is an +fn
.e is a $flag.
Produces
An +fn.
Source
Examples
^sub:fl
Subtract.
Produces the difference of .a minus b. .e is used to choose between an exact result (any-sized significand) or a rounded result (113-bit significand).
Accepts
.a is a cell of a signed integer and an unsigned integer.
.b is a cell of a signed integer and an unsigned integer.
.e is a $flag.
Produces
An +fn.
Source
Examples
^mul:fl
Multiply.
Produces the product of .a multiplied by .b. There is no term to sign the significands, so a positive sign will always be produced.
Accepts
.a is a cell of a signed integer and an unsigned integer.
.b is a cell of a signed integer and an unsigned integer.
Produces
An +fn.
Source
Examples
^div:fl
Divide.
Produces the quotient of .a divided by .b. There is no term to sign the significands, so a positive sign will always be produced.
Accepts
.a is a cell of a signed integer and an unsigned integer.
.b is a cell of a signed integer and an unsigned integer.
Produces
An +fn.
Source
Examples
^sqt:fl
Square root.
Produces the square root of .a.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
An +fn.
Source
Examples
^lth:fl
Less than.
Tests if .a is less than .b.
Accepts
.a is a cell of a signed integer and an unsigned integer.
.b is a cell of a signed integer and an unsigned integer.
Produces
An $flag.
Source
Examples
^equ:fl
Equals.
Tests if .a is equal to .b.
Accepts
.a is a cell of a signed integer and an unsigned integer.
.b is a cell of a signed integer and an unsigned integer.
Produces
A $flag.
Source
Examples
+ibl:fl
Integer binary logarithm.
Produces the lowest power to which the number 2 must be raised to obtain .a or greater.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
A signed integer.
Source
Examples
+uni:fl
Change representation to odd.
Produces another representation of the floating point .a where the significand is odd. Every floating-point number has a unique representation of this kind. If the significand of .a is already odd, nothing changes.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
A cell of a signed integer and an unsigned integer.
Source
Examples
+xpd:fl
Expand.
Produces the fully precise form of .a, or the denormalized form of .a.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
A cell of a signed integer and an unsigned integer.
Sources
Examples
+lug:fl
Central rounding mechanism.
Performs various rounding operations on .a. An operation is chosen based on the value selected for .t. .s is a sticky bit that represents a value less than .
Possible rounding operations:
Floor (
%fl)Ceiling (
%ce)Smaller (
%sm)Larger (
%lg)Nearest (
%ne) -- Rounds ties away from 0 if the number is even, rounds toward 0 if the number is odd.
Accepts
.t is one of the following: %fl, %ce, %sm, %lg, %ne, %na, or %nt.
.a is a cell of a signed integer and an unsigned integer.
.s is a $flag.
Produces
An +fn.
Source
^drg:fl
Get printable decimal.
Produces the decimal form of .a using the Dragon4 algorithm. Guarantees accurate results for rounded floats.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
A cell of a signed integer and an unsigned integer.
Source
Examples
^toj:fl
Round to integer.
Rounds float .a to the nearest decimal float with an exponent of 0.
Accepts
.a is a cell of a signed integer and an unsigned integer.
Produces
An +fn.
Source
Examples
+ned:fl
Require float.
Produces .a if .a is a is of floating-point representation. If .a is another case of +fn, such as infinity or not-a-number, a crash is produced.
Accepts
.a is an +fn.
Produces
A cell of a signed integer and an unsigned integer.
Source
Examples
+shf:fl
Shift power.
Multiplies .a by 2 to the .b power without rounding. This results in shifting the exponent term by .b.
Accepts
.a is an +fn.
.b is a signed integer.
Produces
An +fn.
Source
Examples
+fli:fl
Flip sign.
Produces .a with its signed changed from positive to negative, or vice versa.
Accepts
.a is an +fn.
Produces
An +fn.
Source
Examples
+swr:fl
Switch rounding.
Switches the rounding mode of r:fl.
Source
Examples
Below is the default +fl core.
The second new-fl below is a new +fl core with changed state.
+prc:fl
Force precision of 2 or greater.
Produces .p, the core's precision, if .p is greater than or equal to 2. Otherwise, a crash is produced.
Source
Examples
+den:fl
Behavior.
Produces d:fl. Denormalizes if d:fl is %d. Flushes denormals to zero if d:fl is %f.
Denormalizes if
d:flis%d.Flushes denormals to zero if
d:flis%f.Infinite exponent range if
%dis%i.
The default value of .d is %d.
Source
Examples
+emn:fl
Minimum exponent.
Produces v:fl, the minimum exponent. The default minimum exponent is -16.494.
Source
Examples
+emx:fl
Maximum exponent.
Returns the maximum exponent of +fl. The default maximum exponent is --16.271.
Source
Examples
+spd:fl
Smallest denormal.
Produces the smallest possible denormalized float.
Source
Examples
+spn:fl
Smallest normal.
Produces the smallest representable normal float.
Source
Examples
+lfn:fl
Largest normal.
Produces the largest representable normal float.
Source
Examples
+lfe:fl
Maximum.
Produces the sum of emx:fl plus prc:fl.
Source
Examples
+zer:fl
Zero.
Produces zero represented as a float.
Source
Examples
+rou:fl
Round.
Rounds .a. The way in which .a is rounded depends on the value of r:fl.
Accepts
.a is an +fn.
Produes
An +fn.
Source
Examples
+syn:fl
Get sign.
Produces the sign of .a.
Accepts
.a is an +fn.
Produes
An +fn.
Source
Examples
+abs:fl
Absolute value.
Produces the absolute value of .a.
Accepts
.a is an +fn.
Produes
An +fn.
Sources
Examples
+add:fl
Add.
Produces the sum of .a plus .b.
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +fn.
Source
Examples
+ead:fl
Exact add.
Produces the exact sum of .a plus .b.
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +fn.
Source
Examples
+sub:fl
Subtract.
Produces the difference of .a minus .b.
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +fn.
Source
Examples
+mul:fl
Multiply.
Produces the product of .a multiplied by .b.
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +fn.
Source
+emu:fl
Exact multiply.
Produces the exact product of .a multiplied by .b.
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +fn.
Examples
+div:fl
Divide.
Produces the quotient of .a divided by .b.
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +fn.
Source
+fma:fl
Fused multiply-add.
Produces the sum of .c plus the product of .a multiplied by .b; .
Accepts
.a is an +fn.
.b is an +fn.
.c is an +fn.
Produces
An +fn.
Source
Examples
+sqt:fl
Square root.
Produces the square root of .a.
Accepts
.a is an +fn.
Produces
An +fn.
Source
Examples
+inv:fl
Inverse.
Produces the inverse of .a by dividing 1 by .a.
Accepts
.a is an +fn.
Produces
An +fn.
Source
Examples
+sun:fl
Unsigned integer to float.
Produces .a in floating-point representation.
Accepts
.a is an unsigned integer.
Produces
An +fn.
Source
Examples
+san:fl
Signed integer to float.
Produces the floating-point representation of .a, a signed integer.
Accepts
.a is a signed integer.
Produces
An +fn.
Source
Examples
+lth:fl
Less than.
Tests if .a is less than .b. Returns ~ in the event of .a or .b being a NaN ([%n ~]).
Accepts
.a is an +fn.
.b is an +fn.
Produces
A +unit of $flag.
Source
Examples
+lte:fl
Less than or equal.
Tests whether .a is less than or equal to .b. Returns ~ in the event of .a or .b being a NaN ([%n ~]).
Accepts
.a is an +fn.
.b is an +fn.
Produces
A +unit of $flag.
Source
Examples
+equ:fl
Equals.
Tests if .a is equal to .b. Returns ~ in the event of .a or .b being a NaN ([%n ~]).
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +unit of $flag.
Source
Examples
+gte:fl
Greater or equal than.
Tests whether .a is greater than or equal to .b. Returns ~ in the event of .a or .b being a NaN ([%n ~]).
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +unit of $flag.
Source
Examples
+gth:fl
Greater than.
Tests whether .a is greater than .b. Returns ~ in the event of .a or .b being a NaN ([%n ~]).
Accepts
.a is an +fn.
.b is an +fn.
Produces
An +unit of $flag.
Source
Examples
+drg:fl
Float to decimal.
Produces the decimal form of .a using the Dragon4 algorithm. Guarantees accurate results for rounded floats.
Accepts
.a is an +fn.
Produces
A +dn.
Source
Examples
+grd:fl
Decimal to float.
Converts decimal .a to +fn.
Accepts
.a is a +dn.
Produces
An +fn.
Source
Examples
+toi:fl
Round to signed integer.
Rounds .a to the nearest signed integer.
Accepts
.a is an +fn.
Produces
A +unit of @s.
Source
Examples
+toj:fl
Round to integer fn.
Rounds .a to the nearest decimal integer.
Accepts
.a is an +fn.
Produces
A +unit of @s.
Source
Examples
+ff
IEEE 754 Formatting.
Container core for IEEE 754 formatting operations.
.wis width: The number of bits in the exponent field..pis precision: The number of bits in the significand field..bis bias: Added to exponent when storing..ris rounding mode: Possible modes are nearest (%n), up (%u), down (%d), to zero (%z), and away from zero (%a). Default value is%a.
Source
Examples
Discussion
+ff has no use outside of the functionality provided to other cores: +rd, +rs, +rq, and +rh. It's not intended to be used directly; it's just meant to power those cores.
+sb:ff
Sign bit.
Produces the sign bit of +ff.
Source
Examples
+me:ff
Minimum exponent.
Produces the minimum possible exponent of +ff.
Source
Examples
+pa:ff
Initialize +fl.
Instantiates the core +fl, giving values to its samples based on the configuration of the +ff core.
Source
Examples
Discussion
+pa exists exclusively for internal use of +ff, and +ff exists for internal use in other cores.
+sea:ff
@r to +fn.
Converts .a from @r to +fn.
Accepts
.a is a @r, an IEEE float.
Produces
A +unit of @s.
Source
Examples
+bit:ff
+fn to @r, rounding.
Converts .a from +fn to @r and applies rounding.
Accepts
.a is an +fn.
Produces
A @r.
Source
Examples
+bif:ff
+fn to @r, no rounding.
Converts .a from +fn to @r. No rounding is applied.
Accepts
.a is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+sig:ff
Get sign.
Produces the sign of .a.
Accepts
.a is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+exp:ff
Get exponent.
Produces the exponent of .a.
Accepts
.a is a @r, an IEEE float.
Produces
A signed integer.
Source
Examples
+add:ff
Add.
Produces the sum of .a plus .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A @r, an IEEE float.
Source
Examples
+sub:ff
Sub.
Produces the sum of .a plus .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A @r, an IEEE float.
Source
Examples
+mul:ff
Multiply.
Produces the product of .a multiplied by .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A @r, an IEEE float.
Multiply
Examples
+div:ff
Divide.
Produces the quotient of .a divided by .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A @r, an IEEE float.
Source
Examples
+fma:ff
Fused multiply-add.
Produces the sum of .c plus the product of .a multiplied by .b; .
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
.c is a @r, an IEEE float.
Produces
A @r, an IEEE float.
Source
Examples
+sqt:ff
Square root.
Produces the square root of .a.
Accepts
.a is a @r, an IEEE float.
Produces
A @r, an IEEE float.
Source
Examples
+lth:ff
Less than.
Tests whether .a is less than .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+lte:ff
Less than or equal to.
Tests whether .a is less than or equal to .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+equ:ff
Equals.
Tests whether .a is equal to .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+gte:ff
Greater or equal than.
Tests whether .a is greater than or equal to .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+gth:ff
Greater than.
Tests whether .a is greater than or equal to .b.
Accepts
.a is a @r, an IEEE float.
.b is a @r, an IEEE float.
Produces
A $flag.
Source
Examples
+sun:ff
Unsigned integer to @r.
Converts .a from an unsigned integer (@u) to @r.
Accepts
.a is @u, unsigned integer.
Produces
A @r, an IEEE float.
Source
Examples
+san:ff
Signed integer to @r.
Converts .a from a signed integer to @r.
Accepts
.a is @s, a signed integer.
Produces
A @r, an IEEE float.
Source
Examples
+toi:ff
Round to integer.
Rounds .a to the nearest signed integer.
Accepts
.a is a @r, an IEEE float.
Produces
A $flag of @s.
Source
Examples
+drg:ff
@r to decimal float.
Converts .a from @r to +dn using the Dragon4 algorithm.
Accepts
.a is a @r, an IEEE float.
Produces
A +dn.
Source
Examples
+grd:ff
Decimal float to @r.
Converts .a from +dn to @r.
Accepts
.a is a +dn.
Produces
A @r, an IEEE float.
Source
Examples
+rlyd
Prep @rd for print.
Converts .a from a double-precision binary float to decimal64.
Accepts
.a is a @rd, a double-precision float.
Produces
A +dn.
Source
Examples
+rlys
Prep @rs for print.
Converts .a from a single-precision binary float to decimal32.
Accepts
.a is a @rs, a single-precision float.
Produces
A +dn.
Source
Examples
+rlyh
Prep @rh for print.
Converts .a from a half-precision binary float to decimal16.
Accepts
.a is a @rh, a half-precision float.
Produces
A +dn.
Source
Examples
+rlyq
Prep @rq for print.
Converts .a from a quad-precision binary float to decimal128.
Accepts
.a is a @rq, a quad-precision float.
Produces
A +dn.
Source
Examples
+ryld
Finish parsing @rd.
Converts .a from a decimal float to a double-precision binary float.
Accepts
.a is a +dn.
Produces
A a @rd, a double-precision float.
Source
Examples
+ryls
Finish parsing @rs.
Converts .a from a decimal float to a single-precision binary float.
Accepts
.a is a +dn.
Produces
A a @rs, a single-precision float.
Source
Examples
+rylh
Finish parsing @rh.
Converts .a from a decimal float to a half-precision binary float.
Accepts
.a is a +dn.
Produces
A a @rh, a half-precision float.
Source
Examples
+rylq
Finish parsing @rq.
Converts .a from a decimal float to a quad-precision binary float.
Accepts
.a is a +dn.
Produces
A a @rq, a quad-precision float.
Source
Examples
+rd
Double-precision floating-point operations.
A container core for operations related to double-precision binary floats.
+rd has four rounding modes: round to nearest (%n), round up (%u), round down (%d), and round to zero (%z). The default rounding mode is %z. If you need a different rounding mode, you'd do something like =/ rd-n ~(. rd %n) and then call the arms of your modified version instead.
Source
+ma:rd
Initialize +ff.
Instantiates the core +ff, giving values to its samples based on the configuration of the +rd core. This arm is used internally by +rd, you would not normally call this directly.
Source
Examples
+sea:rd
@rd to +fn.
Converts .a from a double-precision binary float to +fn.
Source
Examples
+bit:rd
+fn to @rd.
Converts .a from +fn to a double-precision binary float.
Accepts
.a is an +fn.
Produces
A @rd, a double-precision float.
Source
Examples
+add:rd
Add.
Produces the sum of .a plus .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A @rd.
Source
Examples
+sub:rd
Subtract.
Produces the difference of .a minus .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A @rd.
Source
Examples
+mul:rd
Multiply.
Produces the product of .a times .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A @rd.
Source
Examples
+div:rd
Divide.
Produces the quotient of .a divided by .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd.
Produces
A @rd.
Source
Examples
+fma:rd
Fused multiply-add.
Produces the sum of .c plus the product of .a multiplied by .b; .
Accepts
.a is a @rd, an IEEE float.
.b is a @rd.
.c is a @rd.
Produces
A @rd.
Source
Examples
+sqt:rd
Square root.
Produces the square root of .a.
Accepts
.a is a @rd, a double-precision float.
Produces
A @rd.
Source
Examples
+lth:rd
Less than.
Test whether .a is less than .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A $flag.
Source
Examples
+lte:rd
Less than or equal.
Test whether .a is less than or equal to .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A $flag.
Source
Examples
+equ:rd
Equals.
Test whether .a is equal to .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A $flag.
Source
Examples
+gte:rd
Greater than or equal.
Test whether .a is greater than or equal to .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A $flag.
Source
Examples
+gth:rd
Greater than.
Test whether .a is greater .b.
Accepts
.a is a @rd, a double-precision float.
.b is a @rd, a double-precision float.
Produces
A $flag.
Source
Examples
+sun:rd
Unsigned integer to @rd.
Converts an unsigned integer .a to @rd.
Accepts
.a is a @u, an unsigned integer.
Produces
A @rd.
Source
Examples
+san:rd
Signed integer to @rd.
Converts a signed integer .a to @rd.
Accepts
.a is a @s, a signed integer.
Produces
A @rd.
Source
Examples
+sig:rd
Get sign.
Produces the sign of .a.
Accepts
.a is a @rd
Produces
A $flag.
Source
Examples
+exp:rd
Get exponent.
Produces the exponent of .a.
Accepts
.a is a @rd
Produces
A @s.
Source
Examples
+toi:rd
Round to integer.
Rounds .a to the nearest integer.
Accepts
.a is a @rd
Produces
A +unit of @s.
Source
Examples
+drg:rd
@rd to decimal float.
Produces the decimal form of .a using the Dragon4 algorithm. Guarantees accurate results for rounded floats.
Accepts
.a is a @rd
Produces
A +dn.
Source
Examples
+grd:rd
Decimal float to @rd.
Converts .a from decimal float to @rd.
Accepts
.a is a @dn
Produces
A @rd.
Source
Examples
+rs
Single-precision floating-point operations.
A container core for operations related to single-precision binary floats.
+rs has four rounding modes: round to nearest (%n), round up (%u), round down (%d), and round to zero (%z). The default rounding mode is %z. If you need a different rounding mode, you'd do something like =/ rs-n ~(. rs %n) and then call the arms of your modified version instead.
Source
+ma:rs
Initialize +ff.
Instantiates the core +ff, giving values to its samples based on the configuration of the +rs core. This arm is used internally by +rs, you would not normally call this directly.
Source
Examples
+sea:rs
@rs to +fn.
Converts .a from @rs to +fn.
Accepts
.a is a @rs, an single-precision float.
Produces
An +fn.
Source
Examples
+bit:rs
+fn to @rs.
Converts .a from +fn to @rs.
Accepts
.a is an +fn.
Produces
A @rs, a single-precision float.
Source
Examples
+add:rs
Add.
Produces the sum of .a plus .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A @rs.
Source
Examples
+sub:rs
Subtract.
Subtracts .a from .b.
Accepts
.a is a @rs.
.b is a @rs.
Source
Examples
+mul:rs
Multiply.
Produces the product of .a multiplied by .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A @rs.
Source
Examples
+div:rs
Divide.
Produces the quotient of .a divided by .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A @rs.
Source
Examples
+fma:rs
Fused multiply-add.
Produces the sum of .c plus the product of .a multiplied by .b; .
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
.c is a @rs.
Produces
A @rs.
Source
Examples
+sqt:rs
Square root.
Produces the square root of .a.
Accepts
.a is a @rs, a single-precision float.
Produces
A @rs.
Source
Examples
+lth:rs
Less than.
Test whether .a is less than .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A $flag.
Source
Examples
+lte:rs
Less than or equal.
Test whether .a is less than or equal to .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A $flag.
Source
Examples
+equ:rs
Equals.
Test whether .a is equal to .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A $flag.
Source
Examples
+gte:rs
Greater than or equal.
Test whether .a is greater than or equal to .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A $flag.
Source
Examples
+gth:rs
Greater than.
Test whether .a is greater than .b.
Accepts
.a is a @rs, a single-precision float.
.b is a @rs.
Produces
A $flag.
Source
Examples
+sun:rs
Unsigned integer to @rs.
Converts .a from an unsigned integer to @rs.
Accepts
.a is an unsigned integer.
Produces
A @rs.
Source
Examples
+san:rs
Signed integer to @rs.
Converts .a from a signed integer to @rs.
Accepts
.a is a signed integer.
Produces
A @rs.
Source
Examples
+sig:rs
Get sign.
Produces the sign of .a.
Accepts
.a is a @rs.
Produces
A $flag.
Source
Examples
+exp:rs
Get exponent.
Produces the exponent of .a.
Accepts
.a is a @rs.
Produces
A signed integer.
Source
Examples
+toi:rs
Round to integer.
Rounds .a to the nearest integer.
Accepts
.a is a @rs.
Produces
A +unit of @s.
Source
Examples
+drg:rs
@rs to decimal float.
Produces the decimal form of .a using the Dragon4 algorithm. Guarantees accurate results for rounded floats.
Accepts
.a is a @rs
Produces
A +dn.
Source
Examples
+grd:rs
Decimal float to @rs.
Converts .a from +dn to @rs.
Accepts
.a is a +dn.
Produces
A @rs.
Source
Examples
+rq
Quadruple-precision fp.
A container core for operations related to quadruple-precision binary floats.
+rq has four rounding modes: round to nearest (%n), round up (%u), round down (%d), and round to zero (%z). The default rounding mode is %z. If you need a different rounding mode, you'd do something like =/ rq-n ~(. rq %n) and then call the arms of your modified version instead.
Source
+ma:rq
Initialize +ff.
Instantiates the core +ff, giving values to its samples based on the configuration of the +rq core. This arm is used internally by +rq, you would not normally call this directly.
Source
+sea:rq
@rq to +fn.
Converts .a from @rq to +fn.
Accepts
.a is a @rq, a quad-precision float.
Produces
An +fn.
Source
Examples
+bit:rq
+fn to @rq.
Converts .a from +fn to @rq.
Accepts
.a is an +fn.
Produces
A @rq, a quad-precision float.
Source
Examples
+add:rq
Add.
Produces the sum of .a plus .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A @rq.
Source
Examples
+sub:rq
Subtract.
Produces the difference of .a minus .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A @rq.
Source
Examples
+mul:rq
Multiply.
Produces the product of .a times .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A @rq.
Source
Examples
+div:rq
Divide.
Produces the product of .a divided by .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A @rq.
Source
Examples
+fma:rq
Fused multiply-add.
Produces the sum of .c plus the product of .a multiplied by .b; .
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
.c is a @rq.
Produces
A @rq.
Source
Examples
+sqt:rq
Square root.
Produces the square root of .a.
Accepts
.a is a @rq, a quad-precision float.
Produces
A @rq.
Source
Examples
+lth:rq
Less than.
Tests whether .a is less than .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A $flag.
Source
Examples
+lte:rq
Less than or equal.
Tests whether .a is less than or equal to .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A $flag.
Source
Examples
+equ:rq
Equals.
Tests whether .a is equal to .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A $flag.
Source
Examples
+gte:rq
Greater than or equal.
Tests whether .a is greater than or equal to .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A $flag.
Source
Examples
+gth:rq
Tests whether .a is greater than .b.
Accepts
.a is a @rq, a quad-precision float.
.b is a @rq.
Produces
A $flag.
Source
Examples
+sun:rq
Unsigned integer to @rq.
Converts .a from an unsigned integer to @rq.
Accepts
.a is a @u, an unsigned integer.
Produces
A @rq, a quad-precision float.
Source
Examples
+san:rq
Signed integer to +rq.
Converts .a from a signed integer to @rq.
Accepts
.a is a @s, a signed integer.
Produces
A @rq, a quad-precision float.
Source
Examples
+sig:rq
Get sign.
Produces the sign of .a.
Accepts
.a is a @rq, a quad-precision float.
Produces
A $flag.
Source
Examples
+exp:rq
Get exponent.
Gets the exponent of .a.
Accepts
.a is a @rq, a quad-precision float.
Produces
A @s, a signed integer.
Source
Examples
+toi:rq
Round to integer.
Rounds .a to the nearest integer.
Accepts
.a is a @rq, a quad-precision float.
Produces
A +unit of @s.
Source
Examples
+drg:rq
@rq to decimal float.
Produces the decimal form of .a using the Dragon4 algorithm. Guarantees accurate results for rounded floats.
Accepts
.a is a @rq, a quad-precision float.
Produces
A +dn.
Source
Examples
+grd:rq
Decimal float to @rq.
Converts .a from +dn to @rq.
Accepts
.a is +dn.
.a is a @rq.
Produces
A @rq, a quad-precision float.
Source
Examples
+rh
Half-precision fp.
A container core for operations related to half-precision binary floats.
+rh has four rounding modes: round to nearest (%n), round up (%u), round down (%d), and round to zero (%z). The default rounding mode is %z. If you need a different rounding mode, you'd do something like =/ rh-n ~(. rh %n) and then call the arms of your modified version instead.
Source
+ma:rh
Initialize +ff.
Instantiates the core +ff, giving values to its samples based on the configuration of the +rh core. This arm is used internally by +rh, you would not normally call this directly.
Source
+sea:rh
@rh to +fn.
Converts .a from @rh to +fn.
Accepts
.a is a @rh, a half-precision float.
Produces
An +fn.
Source
Examples
+bit:rh
+fn to @rh.
Converts .a from +fn to @rh.
Accepts
.a is an +fn.
Produces
A @rh, a half-precision float.
Source
Examples
+add:rh
Produces the sum of .a plus .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A @rh.
Source
Examples
+sub:rh
Subtract.
Produces the difference of .a minus .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A @rh.
Source
Examples
+mul:rh
Multiply.
Produces the product of .a times .b.
Accepts
.a is a @rh, a quad-precision float.
.b is a @rh.
Produces
A @rh.
Source
Examples
+div:rh
Divide.
Produces the product of .a divided by .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A @rh.
Source
examples
+fma:rh
Fused multiply-add.
Produces the sum of .c plus the product of .a multiplied by .b; .
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
.c is a @rh.
Produces
A @rh.
Source
Examples
+sqt:rh
Square root.
Produces the square root of .a.
Accepts
.a is a @rh, a half-precision float.
Produces
A @rh.
Source
Example
+lth:rh
Less than.
Tests whether .a is less than .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A $flag.
Source
Examples
+lte:rh
Less than or equal.
Tests whether .a is less than or equal to .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A $flag.
Source
Examples
+equ:rh
Equals.
Tests whether .a is equal to .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A $flag.
Source
Examples
+gte:rh
Greater than or equal.
Tests whether .a is greater than or equal to .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A $flag.
Source
Examples
+gth:rh
Tests whether .a is greater than .b.
Accepts
.a is a @rh, a half-precision float.
.b is a @rh.
Produces
A $flag.
Source
Examples
+tos:rh
@rh to @rs.
Converts @ from @rh to @rs.
Accepts
.a is a @rh, a half-precision float.
Produces
A @rs, a single-precision float.
Source
Examples
+fos:rh
@rs to @rh.
Converts @ from @rs to @rh.
Accepts
.a is a @rs, a single-precision float.
Produces
A @rh, a half-precision float.
Source
Examples
+sun:rh
Unsigned integer to @rh.
Converts .a from an unsigned integer to @rh.
Accepts
.a is a @u, an unsigned integer.
Produces
A @rh, a half-precision float.
Source
Examples
+san:rh
Signed integer to @rh.
Converts .a from a signed integer to @rh.
Accepts
.a is a @s, a signed integer.
Produces
A @rh, a half-precision float.
Source
Examples
+sig:rh
Get sign.
Produces the sign of .a.
Accepts
.a is a @rh, a half-precision float.
Produces
A $flag.
Source
Examples
+exp:rh
Get exponent.
Gets the exponent of .a.
Accepts
.a is a @rh, a half-precision float.
Produces
A @s, a signed integer.
Source
Examples
+toi:rh
Round to integer.
Rounds .a to the nearest integer.
Accepts
.a is a @rh, a half-precision float.
Produces
A +unit of @s.
Source
Examples
+drg:rh
@rh to decimal float.
Produces the decimal form of .a using the Dragon4 algorithm. Guarantees accurate results for rounded floats.
Accepts
.a is a @rh, a half-precision float.
Produces
A +dn.
Source
Examples
+grd:rh
Decimal float to @rh.
Converts .a from +dn to @rh.
Accepts
.a is +dn.
.a is a @rh.
Produces
A @rh, a a half-precision float.
Source
Examples
Last updated