Skip to content

Commit 660b108

Browse files
committed
[S02] define .Stringy and .gist for Num and Rat
leave a bit of wiggle room in the Num stringification fow now.
1 parent 3e1a9a5 commit 660b108

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

S02-bits.pod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,11 @@ calculation, with the same result on decimal-normalizable fractions,
775775
but where C<.perl> would produce the C<-47/3> form, stringification instead
776776
converts to C<Num> and stringifies that, so the rational internal form is
777777
somewhat hidden from the casual user, who would generally prefer
778-
to see pure decimal notation.
778+
to see pure decimal notation. C<Rat.gist> follows the same rules as
779+
stringification.
780+
781+
C<Num.Str> and C<Num.gist> both produce valid Num literals, so they must
782+
include the C<e> for the exponential.
779783

780784
say 1/5; # 0.2 exactly (not via Num)
781785
say 1/3; # 0.333333333333333 via Num
@@ -794,6 +798,7 @@ to see pure decimal notation.
794798

795799
say <555555555555555555555555555555555555555555555/5>.perl
796800
# 111111111111111111111111111111111111111111111/1
801+
say 2e2; # 200e0 or 2e2 or 200.0e0 or 2.0e2
797802

798803
=head2 Infinity and C<NaN>
799804

0 commit comments

Comments
 (0)