Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CaR Grant] Spec Rational.base-repeating with no args
  • Loading branch information
zoffixznet committed May 12, 2018
1 parent e5292c9 commit 7263105
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions S32-num/base.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 63;
plan 65;

# Int
{
Expand Down Expand Up @@ -68,8 +68,15 @@ plan 63;

# base-repeating
{
is (1/65535).base-repeating(10).Str, '0.0 0001525902189669642175936522468909742885481040665293354695963988708323796444647898069733730067902647440299076829175249866483558403906309605554283970397497520408941786831464103150988021667811093308918898298619058518348973830777447165636682688639658197909514', '1/65536 repeats with 256 char cycle';
is (1/7).base-repeating(10).Str, '0. 142857', '1/7 repeats with 6 char cycle';
my $rep := '0.0 0001525902189669642175936522468909742885481040665293354695963988708323796444647898069733730067902647440299076829175249866483558403906309605554283970397497520408941786831464103150988021667811093308918898298619058518348973830777447165636682688639658197909514';
is (1/65535).base-repeating(10).Str, $rep,
'1/65536 repeats with 256 char cycle';
is (1/65535).base-repeating.Str, $rep,
'1/65536 repeats with 256 char cycle (implied base)';
is (1/7).base-repeating(10).Str, '0. 142857',
'1/7 repeats with 6 char cycle';
is (1/7).base-repeating.Str, '0. 142857',
'1/7 repeats with 6 char cycle (implied base)';
is 3.1416.base-repeating(36).Str, '3.5 3IHMIRZRPEGH1SA4YBV5TFLY1HWW0X6E63SUVG6OJCQ9K7U0CFWBAFBKSKI799UL2XR4NYM8EQUAPOTPZ6YWLNO8ZHC5J2D0MT58P4384DLDB022NDVQJXGRF17JN', '3.1416 repeats in base 36';
}

Expand Down

0 comments on commit 7263105

Please sign in to comment.