Numerics
Int, Rat, Num, Complex: arithmetic, rounding, overflow, and parsing numbers.
137 rules from 90 tests. 78 of those tests are confirmed on both engines: Raku++ and Rakudo 2026.11 both pass, or Raku++ gives Rakudo's answer on every probe of a family. The verdict is the test's, not each rule's. How to read a case.
6e-gatingRaku++ passesRakudo cannot run it- 12
From 6.e
logandlog10of a negative Num give the complex logarithm; before 6.e they give NaN.(-1e0).logis0+3.141592653589793iunder 6.e
More from this test: Dates & times (2), Exceptions & control flow (1), Hashes & sets (3), I/O & processes (2), Lists & laziness (8), Classes, roles & the MOP (2), Operators (1), Everything else (2), Regexes & grammars (2), Scoping & phasers (2), Signatures & dispatch (1), Strings & Unicode (6), divergences (1).
approx-equal-toleranceRaku++ passesRakudo passesarray-op-args-getc-get-and-friendsRaku++ passesRakudo passes- 4
**with an Int base and a huge Int exponent is computed exactly, so-1raised to an odd bigint is-1.(-1) ** 4553535345364535345634543533is not1
More from this test: Compile-time errors (1), Hashes & sets (1), I/O & processes (1), Classes, roles & the MOP (1), Signatures & dispatch (2).
base-exact-and-exp-baseRaku++ passesRakudo passes- 1
.basecomputes its digits exactly, however long the expansion or small the value.(2/3).base(10, 40)is sixes to the last digit;(1/10000000000).base(3)is not0.000000 - 2
.basewith an explicit digit count pads an integer with zeros, rounds a carry into the integer part, and refuses a negative digit count.121.base(11, 3)ends.000;(98/99).base(10, 0)is1 - 3
.exp($base)is$base ** self, the inverse of.log($base).5.exp(2)is32
base-repeating-integral-and-long-cyclesRaku++ passesRakudo passes- 1
Rat.base-repeatinganswers a repeating cycle longer than 10,000 digits in full instead of truncating it with an empty cycle.(1/10007).base-repeatinghas a 10,006-digit cycle - 2
.base-repeatingof an integral Rat has no trailing point.(4/1).base-repeatingis("4", "")
More from this test: divergences (1).
batch1-silent-wrong-answersRaku++ passesRakudo passes- 2
.parse-base,.UIntand.base-repeatingrefuse bad input with an armed Failure (X::Str::Numeric, X::Syntax::Number::RadixOutOfRange, X::OutOfRange) that throws when used in arithmetic.
More from this test: I/O & processes (3), Lists & laziness (2), Everything else (2), Scoping & phasers (1).
batch11b-typed-blobsRaku++ passesRakudo passes- 3
A radix literal takes a list of digit values in brackets. inferred
:256[97, 98, 99, 128]is0x61626380 - 6
A value pushed to a
uint32native array wraps modulo 2**32. inferredpushing
0xFFFFFFFF + 5tomy uint32 @mstores 4
More from this test: Syntax & parsing (2), Types & coercion (2).
bitwise-huge-intsRaku++ passesRakudo passes- 2
+&,+|and+^on big Ints work on the infinite two's complement, for either sign of either operand and in either operand order.
blob-iteration-and-mutate-lvalueRaku++ passesRakudo passes- 3
parse-baseexists as a sub as well as a method, as inparse-base($str, 16).
More from this test: Containers & assignment (1).
cbor-and-nqp-buffer-opsRaku++ passesRakudo does not pass- 3
Assigning a double to a
num32variable rounds it to single precision.
More from this test: Syntax & parsing (1), Types & coercion (2).
complex-words-order-and-allomorph-newRaku++ passesRakudo passes- 1
valand a word-list word take a digitless Complex only when it ends inInf\ior isNaN\i; an imaginary NaN with a sign or a real part, a bareiand a spelling without\istay Str.<0+NaNi>is a Str, not a ComplexAlso held by
val-complex-inf-nan.
More from this test: Operators (1), Types & coercion (1).
conformance-phase3-containersRaku++ passesRakudo passes- 3
Complex.realsreturns aList.
More from this test: Lists & laziness (1), Stringification (1), Syntax & parsing (1).
cool-round-and-numeric-failuresRaku++ passesRakudo passes- 1
.round($scale)is(self / $scale + 1/2).floor * $scalecomputed exactly whenever neither side is aNum, so anIntstays anIntand a Rat scale leaves no float drift.round(1000, 23.01)does not come out as989.4300000000001 - 2
Coercing a non-numeric string with
.Int,.Num,.Numeric,.Rat,.FatRator.Complexgives aFailurecarryingX::Str::Numeric, as prefix+does. - 3
A string that spells a Complex number answers numeric routines as that Complex.
abs "6+8i"is10
corpus-batch-1Raku++ passesRakudo passes- 3
Converting a
Ratwith big numerator or denominator toNumrounds exactly once, giving the correctly rounded double.
More from this test: Containers & assignment (1).
custom-real-bridgesRaku++ passesRakudo passes- 1
A class that
does Realnumifies through its own.Bridgein the sub forms such aslog,cis,unpolarandis-approx, as it does in the method forms. - 2
The default
.Bridge, delegating to.Num, comes with theRealrole only: aCoolclass with its own.Numerichas no.Bridgeand numifies through.Numeric.a class whose
.Numericis Complex keeps its complex value
digest-native-widths-clusterRaku++ passesRakudo passes- 6
Radix literals keep their exact value beyond the signed 64-bit range.
0xFFFFFFFFFFFFFFFFis18446744073709551615 - 7
The radix conversion
:16("…")is exact beyond the signed 64-bit range.:16("FFFFFFFFFFFFFFFF")is18446744073709551615;:16("c.8")is12.5 - 8
A 64-bit blob element reads back unsigned.
blob64.new(0xFFFFFFFFFFFFFFFF).list[0]is18446744073709551615 - 9
.polymoddivides exactly when the invocant is larger than a native integer.0xFFFFFFFFFFFFFFFF.polymod(256 xx 7).reverseis eight 255sAlso held by
digest-bigint-and-native-cluster.
More from this test: Containers & assignment (2), Lists & laziness (2), Operators (2), Scoping & phasers (1).
divergence-result-typesRaku++ passesRakudo passes- 4
A numeric string used in arithmetic enters the exact numeric tower (
Int/Rat), notNum. inferred1 * "2"is anInt,1 / "2"aRat - 7
A list in numeric context is its element count. inferred
(1, 2) + (3, 4, 5)is5, anInt - 9
Numifying a non-numeric string with prefix
+gives an undefinedFailurethat throws when used, while the empty string numifies to 0. inferred+"a"is aFailure;(+"") == 0
More from this test: Lists & laziness (3), Operators (2), Types & coercion (1).
divide-by-zero-failureRaku++ passesRakudo passes- 1
Dividing by zero yields a
FailurecarryingX::Numeric::DivideByZero, whose message names the operator actually used.
More from this test: Exceptions & control flow (1), divergences (1).
divmod-zero-6eRaku++ passesRakudo does not pass- 1
Under 6.d
1 div 0is a Failure and1 mod 0throws X::Numeric::DivideByZero; under 6.e both are Failures.1 mod 0throws under 6.d and soft-fails under 6.e
More from this test: divergences (1).
ecosweep-900-batchRaku++ passesRakudo passes- 5
NaN.Intis a Failure, not an immediate throw.
More from this test: Containers & assignment (1), I/O & processes (1), Lists & laziness (4), Operators (2), Regexes & grammars (1), Signatures & dispatch (2), Stringification (1), Syntax & parsing (1).
enum-raku-and-divzeroRaku++ passesRakudo passes- 2
div,mod,%and%%by zero throw, sotrycatches the error.try { 3 div 0 }catches an exception - 3
/by zero is lazy:1/0is the Rat<1/0>and does not throw at once.1/0is<1/0>
More from this test: Stringification (1).
exe-allomorph-literal-nativeRaku++ passesRakudo passes- 3
A negative-zero Num literal keeps its sign, in
-0e0, inval(<-0e0>)and in the real part of<-0-0i>.val(<-0e0>)is not +0
More from this test: Types & coercion (1).
exe-float-fast-pathsRaku++ passesRakudo cannot run it- 1
Prefix
-on0e0answers-0, and prefix-on an object numifies it through its.Numeric.-$xwith$x = 0e0is-0
exe-num-lane-bailsRaku++ passesRakudo cannot run itexpmod-modulus-must-be-positiveRaku++ passesRakudo passes- 1
expmodwith a modulus of zero or less throws (an X::AdHoc) instead of answering.expmod(3, 5, 0),expmod(3, 5, -7)andexpmod(-3, 5, -7)die
More from this test: divergences (1).
fatrat-str-and-new-argumentsRaku++ passesRakudo passes- 2
Rat.newandFatRat.newbindInt:D \nu, Int:D \de, so a Rat, Num or Str argument dies instead of being truncated to an integer.FatRat.new(…, 18890217959702350060800.0)dies
More from this test: Stringification (1).
fractional-rangeRaku++ passesRakudo passes- 1
A Range with a fractional endpoint keeps that endpoint for membership tests.
2.4 ~~ 0..^2.5is True
More from this test: Stringification (1).
gcd-lcm-at-int64-minRaku++ passesRakudo passes- 1
gcdandlcmare never negative, including when an operand is-2**63.-2**63 gcd 0,-2**63 gcd -2**63and-2**63 lcm 1are positive
grand-review-c1-interpRaku++ passesRakudo passes- 12
%%on a Num dividend does not truncate it to an integer.4.5e0 %% 2is False - 17
Prefix
+on an undefined scalar gives the Int 0, and prefix-gives 0.(+$u).^nameisInt - 19
A negative count for
+>shifts left.5 +> -1is10 - 20
absof -2**63 is the exact positive Int.abs(-9223372036854775808)is9223372036854775808 - 22
<=>with a NaN operand isNil.NaN <=> 0isNil - 23
A Complex with a zero imaginary part numifies to its real part where a Real is wanted.
sprintf("%d", 3+0i)is3 - 24
Converting a big Int to Num is correctly rounded.
(2**200).Num == 2e0 ** 200is True
More from this test: Containers & assignment (1), Exceptions & control flow (3), I/O & processes (1), Operators (4), Scoping & phasers (4), Signatures & dispatch (3), Stringification (1), Strings & Unicode (1).
grand-review-c2-methodsRaku++ passesRakudo passes- 1
Rounding a Num beyond 2**63 is exact:
.floor,.ceiling,.round,.truncateand.UIntreturn the full Int.1e19.flooris10000000000000000000 - 2
.UInton a negative Int is a Failure.(-(2**70)).UInt.definedis False - 3
.Numericon a Complex is the Complex itself.(3+4i).Numericis3+4i - 7
.basewith a radix outside 2..36 dies.255.base(37)and255.base(1)die;255.base(16)isFF
More from this test: Hashes & sets (1), I/O & processes (6), Lists & laziness (1), Everything else (1), Strings & Unicode (3).
grand-review-c3-procsRaku++ passesRakudo passes- 6
A Num beyond 2**63 converts to Int exactly.
1e19.Intis10000000000000000000;1e300.Int.charsis301
More from this test: I/O & processes (5).
int-kernel-modRaku++ passesRakudo passes- 2
Over Ints
modand%compute the same floored modulo, but with a zero divisormodthrows where%answers a Failure.
int-over-int-small-ratRaku++ passesRakudo passes- 1
Int / Intanswers a reduced Rat with a positive denominator, and a Rat with a zero denominator forx / 0.
int-word-ops-hot-pathRaku++ passesRakudo passes- 1
divfloors andmodtakes the divisor's sign, and a zero divisor fails or throws. - 2
Int operators whose result leaves the 64-bit range answer a big Int:
-2**63 div -1,-2**63 gcd 0and a power past int64. - 3
An Int raised to a negative Int power is a Rat.
More from this test: divergences (1).
iospec-parts-and-numeric-identityRaku++ passesRakudo passes- 5
.Numericand.Realon a value that is already numeric return it unchanged, so anIntorRatis not turned into aNum.
More from this test: I/O & processes (4), Lists & laziness (1), Strings & Unicode (1), Types & coercion (1).
itemization-and-list-foldsRaku++ passesRakudo passes- 5
.lsb,.msband.baseare exact on integers wider than 64 bits.
More from this test: Containers & assignment (1), Lists & laziness (3), Operators (2), Regexes & grammars (1), Stringification (1).
json-codec-number-typing-and-nfcRaku++ passesRakudo passes- 1
Rakudo::Internals::JSON(JSON::Fast) types a JSON number exactly asStr.Numericdoes — type, value and normal form — including integers and decimals at the 18/19-digit seam and every exponent form.
More from this test: Strings & Unicode (1).
json-fast-clusterRaku++ passesRakudo does not pass- 8
The parameterized role
Rational[Int,Int]can be instantiated with.new.Rational[Int,Int].new(3,10) == 0.3is True
More from this test: Containers & assignment (1), Operators (1), Signatures & dispatch (1), Strings & Unicode (1), Types & coercion (6).
kernel-closure-calleesRaku++ passesRakudo passes- 2
1 +< $nwith$nequal to-2**63answers 1.1 +< -2**63is1
More from this test: Scoping & phasers (1).
lizmat-nqp-opsRaku++ passesRakudo passes- 2
nqp::div_ifloors,nqp::mod_itruncates toward zero, andnqp::mod_Ifloors.nqp::mod_i(-7, 2)is-1
More from this test: Lists & laziness (1), Operators (1), Everything else (1), Types & coercion (1).
match-numifies-exact-nativeRaku++ passesRakudo passes- 1
Arithmetic on a Match numifies the text it matched as a Str does, giving an Int, Rat or Num by the literal.
+$0,0 + $0and$0 * 1of 「42」 are the Int 42
match-numify-intRaku++ passesRakudo passes- 1
Numifying a
Matchfollows the string numification ladder: a capture of digits numifies toIntand a decimal toRat, never a blanketNum.+$0of a digit capture isInt;-"9.5"isRat
method-argument-edgesRaku++ passesRakudo passes- 1
.logwith an explicit base divides by the base's logarithm, so a base of 0 gives-0(NaNfor0.log(0)) and a base of 1 is a division by zero.5.log(0)is-0,0.log(0)isNaN,5.log(1)is a division by zero
More from this test: Strings & Unicode (1), divergences (1).
method-call-shapes-and-core-tablesRaku++ passesRakudo passes- 12
Nil.absis the Int 0.Nil.absis0
More from this test: Containers & assignment (1), Classes, roles & the MOP (9), Operators (1), Strings & Unicode (1), Syntax & parsing (2).
minmax-real-rangeRaku++ passesRakudo passes- 2
.minmaxof a lone Num or Rat is a Range of that value, not an Int Range.2.5.minmaxis not2..2
More from this test: Lists & laziness (1).
module-page-sextetRaku++ passesRakudo passes- 9
A radix digit list
:256[…]yields a big Int when the value exceeds 64 bits.
More from this test: Classes, roles & the MOP (3), Regexes & grammars (7), Stringification (2), Strings & Unicode (1).
msb-lsb-builtinsRaku++ passesRakudo passes- 1
msbandlsbanswer the position of an Int's highest and lowest set bit, counting from 0, and both answer Nil for zero. - 2
For a negative Int,
msbanswers the two's-complement position, which is the bit length of |n| - 1, in both the sub and the method form.msb(-1)is0andmsb(-255)is8Also held by
numeric-coercions-and-refusals. - 3
lsbignores the sign: a negative Int has the same lowest set bit as its magnitude.
msb-lsb-huge-intsRaku++ passesRakudo passes- 2
msbof a negative Int is the two's-complement answer, the bit length of |n| - 1, andlsbignores the sign.msb(-2**N)is N butmsb(-2**N - 1)is N + 1Also held by
msb-lsb-js-backend.
native-int-folded-literalRaku++ passesRakudo passes- 1
A native int operator takes a literal expression folded at compile time (
2**62,1 +< 62,-2**62) as it takes a written literal, so the operation stays native and wraps.sub f(int $x) { $x * 2**62 }; f(3)is -4611686018427387904 - 2
A native int combined with an Int held in a variable, or with a folded value wider than 64 bits, takes the Int candidate and grows.
nqp-div-mod-by-minus-oneRaku++ passesRakudo passes- 1
nqp::div_iof the int64 minimum by -1 answers the int64 minimum andnqp::mod_iof it by -1 answers 0, on every machine.
nqp-json-fast-supportRaku++ passesRakudo passes- 1
.Numericand.Realon a numeric string give the type the string spells (Int,Rat,Num), never a blanketNum.
More from this test: Signatures & dispatch (1).
nude-only-on-rationalsRaku++ passesRakudo passesnum-beside-rat-literalRaku++ passesRakudo passes- 1
A decimal literal is a Rat, and a Num beside a Rat computes with the Rat's
.Numand answers a Num, while an Int or a Rat beside a Rat still makes a Rat.$x * 1.0000001 + 0.000000001over a Num$xequals the same arithmetic written withe0literals
num-past-int64-integer-opsRaku++ passesRakudo passes- 1
div,mod,gcd,lcmand the bitwise+&,+|,+^take a Num operand of 2**63 or more as the Int it exactly is.1e20 div 7is14285714285714285714,1e20 +& 255is0,1e20 gcd 10is10
num-rat-continued-fractionRaku++ passesRakudo times out- 1
Num.Rat($epsilon)walks the continued fraction of the double and stops when the fractional part reaches 0 or the correctly rounded convergent is within epsilon, with convergents of any size.1e-300.Rat(0)is 1/10**300 - 2
Num.Rat(0)is not the double's exact binary value.0.1e0.Rat(0)is1/10
More from this test: divergences (1).
numeric-coercions-and-refusalsRaku++ passesRakudo does not pass- 1
The sub forms of the rounders pass a non-finite value through, as the method forms do.
floor(NaN)is not0andfloor(Inf)is not the int64 maximum - 5
.narrowon a Num tests for integrality approximately.((.1e0 + .2e0) * 10).narrowis an Int - 7
A string with a Unicode MINUS SIGN numifies like one with an ASCII hyphen, keeping the sign of zero.
"−0".Numis-0e0
More from this test: Compile-time errors (1), Types & coercion (2).
pdf-family-2026-09Raku++ passesRakudo passes- 18
Match.Ratis exact: the matched text read as a Rat.
More from this test: Containers & assignment (8), Exceptions & control flow (1), I/O & processes (1), Lists & laziness (1), Modules (1), Classes, roles & the MOP (14), Operators (1), Regexes & grammars (3), Scoping & phasers (4), Signatures & dispatch (9), Syntax & parsing (11), Types & coercion (3).
polymod-answers-seqRaku++ passesRakudo passes- 1
.polymodreturns a Seq, for an Int, a big Int, a Real, an infinite divisor list and a Junction divisor alike.10.polymod(3, 2).rakuis(1, 1, 1).Seq
polymod-divisor-rulesRaku++ passesRakudo passes- 1
.polymodrefuses a zero divisor whatever the invocant, a big Int included, and however the divisors come, a lazy list included.(2**70).polymod(0)and5.polymod(0 xx *)are refused - 2
.polymodon a big Int treats divisors as on a small Int: a divisor of 1 ends the list and a divisor past an int64 divides by its true value. inferred
polymod-junction-and-real-stepsRaku++ passesRakudo passes- 1
.polymodtakes a Junction divisor whole instead of autothreading the call.1.polymod(2 & 3)is(all(1, 1) 0) - 2
.polymodon a non-Int Real stops at a divisor of 1, accepts an infinite divisor list, fails for a negative invocant, and names polymod in its divide-by-zero error.2.5.polymod(1, 2)is not(0.5 0 1) - 3
Only an infinite divisor list lets
.polymodstop early once the quotient reaches 0; a finitelazydivisor list is used in full. inferred
prefix-minus-int64-minRaku++ passesRakudo passes- 1
Prefix
-on the minimum 64-bit integer promotes to a big Int instead of wrapping.-(-9223372036854775808)is9223372036854775808
prefix-minus-object-keeps-numeric-kindRaku++ passesRakudo passes- 1
-$objnegates what the object'sNumericmethod answers and keeps its numeric kind — a big Int, a Rat or a Complex — as+$objreturns each intact.a
Numericof 1/3 gives<-1/3>and one of 1+2i gives -1-2i
prefix-plus-boxes-nativeRaku++ passesRakudo passes- 1
+$nof a native is the boxed number, sinceprefix:<+>has no native candidate, while-$nstays native.f(+$n)takes a multi'sIntcandidate (Numfor a native num) wheref($n)takes itsint
prefix-plus-failure-nativeRaku++ passesRakudo passes- 1
Prefix
+of a string or a Match that is not a number is a Failure, and of a number it is that number.+"=42"is a Failure, and so is+$/of 「=42」
radix-prefix-too-long-is-no-numberRaku++ passesRakudo passes- 1
A string whose
:N<…>radix is larger than any int holds is no number: converting it gives a Failure, "Cannot convert radix of N (max 36)".+":4294967298<11>"is a Failure, "Cannot convert radix of 4294967298 (max 36)"
range-construction-and-membershipRaku++ passesRakudo passes- 3
Numifying an endless range gives Inf.
+(1..*)isInf - 5
Range membership is exact for integers beyond the native limits and for unbounded ends.
2**70 ~~ 1..*and(2**64-1) ~~ uint64.RangeareTrue
More from this test: Lists & laziness (4), Operators (1), Types & coercion (1).
range-randRaku++ passesRakudo passes- 1
.randon a numeric Range returns a Num drawn uniformly from the range.($min .. $max).randlies between the endpoints
rat-num-rounds-ties-to-evenRaku++ passesRakudo passes- 1
A Rat or FatRat with parts wider than 2**53 converts to Num correctly rounded, once, ties to even, also when its value sits exactly halfway between two doubles or a hair past halfway.
rat-rounding-exactRaku++ passesRakudo passes- 1
The subs
floor,ceilingandroundcompute exactly on a Rat or FatRat too wide for a double, agreeing with the method forms.floor(FatRat.new(10**55 - 1, 10**55))is0
roast-3log-batch2Raku++ passesRakudo passes- 3
A C99 hexadecimal float literal is a Num.
0x1.8p1is a Num
More from this test: Exceptions & control flow (1), Modules (1), Classes, roles & the MOP (6), Everything else (1), Regexes & grammars (5), Scoping & phasers (1), Syntax & parsing (1).
roast-last-filesRaku++ passesRakudo passes- 1
An Int power whose exponent fits in 32 bits is computed exactly, and one with a wider exponent answers an overflow Failure rather than throwing. inferred
(2 ** 1_000_000) ~~ Intis True;3 ** 2**32is a Failure - 2
An Int raised to a negative power whose result is below the smallest double is
X::Numeric::Underflow, while the same for a Rat base is a plain0e0. inferred - 3
A Rat power whose exact answer is too large to stay a Rat is a Num with the digits exact division would give. inferred
1.0000001 ** 1_000_000is1.1051709125497935e0
More from this test: Compile-time errors (1), Containers & assignment (2), Lists & laziness (2), Classes, roles & the MOP (1), Operators (1), Scoping & phasers (2).
round-to-scaleRaku++ passesRakudo passes- 1
.round($scale)answers in the scale's type: an Int scale gives an Int, a Rat scale an exact Rat, and only a Num scale a Num.178.14159e0.round(0.1)is178.1
scalars-nil-junction-complex-dateRaku++ passesRakudo passes- 5
Num.newconstructs aNumfrom its argument. inferred - 6
Complex
sqrt, as method and as sub, is computed from the modulus, without losing a unit in the last place on the real part. - 7
.narrowon a Complex with zero imaginary part narrows all the way, so a whole-number real part becomes anInt.
More from this test: Concurrency (1), Containers & assignment (1), Dates & times (1), Classes, roles & the MOP (1), Operators (1), Everything else (1), Stringification (1), Syntax & parsing (1), Types & coercion (1).
seq-bigint-gist-capRaku++ passesRakudo passes- 1
The
...sequence operator computes deduced arithmetic and geometric integer terms exactly beyond 2^63.1, 2, 4 ... *keeps doubling past 2^63
More from this test: Stringification (1).
shift-count-does-not-fit-native-intRaku++ passesRakudo passes- 1
A shift count that does not fit a native int makes
+<and+>throw "Cannot unbox N bit wide bigint into native integer" with the exact bit width.1 +< (2**70)throws instead of hanging; Roast expectsCannot unbox 101 bit wide bigint into native integer
small-rat-spill-rounds-onceRaku++ passesRakudo passes- 1
A Rat result whose denominator would pass 2**64 becomes a Num.
Also held by
int-over-int-small-rat. - 2
The Num a Rat result spills to is the double nearest the exact value, the same as the sum taken in FatRat and converted at the end.
1/4611686018427387903 + 3/999999999999999989is3.216840434497101e-18
str-abs-numifies-exactlyRaku++ passesRakudo passes- 1
.abson a Str numifies it exactly, as.Numericdoes, so an integer string gives an Int and not a Num."5000000000000000000".absis the Int5000000000000000000, not5e+18
succ-pred-exact-towerRaku++ passesRakudo passes- 1
.succand.predon a number areself + 1andself - 1in the number's own type: a bigint stays exact, a Rat or Num keeps its fraction and a Complex its imaginary part.(10**30).succis10**30 + 1;2.5.succis2.5 + 1
sum-and-junction-object-numericRaku++ passesRakudo passes- 1
.sumandsum(…)take an object through its.Numeric.($a, $b).sumis19for two objects with amethod Numeric - 2
An operator autothreaded over a junction numifies each object eigenstate through its
.Numeric.any($a, $b) == 9isany(False, True) - 3
.sumadds with the core+, so a usermulti infix:<+>takes no part in it.
sum-through-the-exact-towerRaku++ passesRakudo passestop100-roots-2026-09-02Raku++ passesRakudo does not pass- 10
A bare
iis a word, not the imaginary unit:val("i")is a Str and"is".Numericfails, whileval("1i")is a Complex.val("i") ~~ Numericis False
More from this test: Containers & assignment (1), Exceptions & control flow (2), Lists & laziness (1), Modules (1), Native types & NativeCall (3), Classes, roles & the MOP (4), Regexes & grammars (3), Scoping & phasers (1), Stringification (1), Strings & Unicode (2), Syntax & parsing (3), Types & coercion (6).
typed-subtree-native-and-rat-leavesRaku++ passesRakudo passes- 2
An operation on native ints wraps and stays native, a store into a sized native wraps to its width, and assigning a new Rat to a variable leaves another holder of the old Rat unchanged. inferred
unclear-reread-fixesRaku++ passesRakudo does not pass- 3
.basewith:no-trailing-zeroesdrops a Rat's trailing zeroes (and the point when nothing is left), while an Int and a Num keep theirs. inferred<1/2>.base(10, 20, :no-trailing-zeroes)is0.5
More from this test: Operators (1), Strings & Unicode (1).
unicode-num-sigma-fold-collateRaku++ passesRakudo passes- 1
A string of non-ASCII decimal digits (Unicode Nd), such as Arabic-Indic or Devanagari numerals, converts to a number positionally.
"٤٢".Intreads the two-digit number instead of throwing
More from this test: Regexes & grammars (1), Strings & Unicode (2).
uninit-warning-names-and-placeRaku++ passesRakudo cannot run it- 2
An uninitialized value in numeric context (
$u + 1,$u.Numeric,abs($u)) warns. - 4
A numeric type object is not a number:
Int + 1treatsIntas an uninitialized value in numeric context. inferred
More from this test: Exceptions & control flow (1), Syntax & parsing (1).
user-operators-compiledRaku++ passesRakudo times out- 3
A built-in arithmetic operator numifies an object operand through its
.Numeric(or.Bridge), in the infix, in[*], inZ*and in a compound assignment like$v += 1.$v * $wover a class with a.Numericis the product of those numbers, not 0Also held by
metaop-object-operands-user-infix.
More from this test: Operators (1).
value-identityRaku++ passesRakudo passes- 6
Rat.Rangeis-Inf..Inf.
More from this test: Hashes & sets (1), Operators (1), Types & coercion (3).
where-sees-earlier-params-ov-and-cursorRaku++ passesRakudo passes- 4
A Range in numeric comparison is its element count.
4 > 1..3asks 4 > 3;2 > (1..4)is False
More from this test: Regexes & grammars (2), Signatures & dispatch (1).
zero-denominator-rat-orderingRaku++ passesRakudo passeszero-denominator-rat-ordersRaku++ passesRakudo passes- 1
A zero-denominator Rat is equality-compared as its Num, but ordered against other values by ordinary cross-multiplication.
<0/0> <= 1isTrue, while$z == $zisFalsefor<0/0>Also held by
zero-denominator-rat-ordering.