Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[S02] define .Stringy and .gist for Num and Rat
leave a bit of wiggle room in the Num stringification fow now.
  • Loading branch information
moritz committed Oct 26, 2011
1 parent 3e1a9a5 commit 660b108
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion S02-bits.pod
Expand Up @@ -775,7 +775,11 @@ calculation, with the same result on decimal-normalizable fractions,
but where C<.perl> would produce the C<-47/3> form, stringification instead
converts to C<Num> and stringifies that, so the rational internal form is
somewhat hidden from the casual user, who would generally prefer
to see pure decimal notation.
to see pure decimal notation. C<Rat.gist> follows the same rules as
stringification.

C<Num.Str> and C<Num.gist> both produce valid Num literals, so they must
include the C<e> for the exponential.

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

say <555555555555555555555555555555555555555555555/5>.perl
# 111111111111111111111111111111111111111111111/1
say 2e2; # 200e0 or 2e2 or 200.0e0 or 2.0e2

=head2 Infinity and C<NaN>

Expand Down

0 comments on commit 660b108

Please sign in to comment.