On 9/28/18 12:34 PM, Curt Tilmes wrote:

On Fri, Sep 28, 2018 at 2:57 PM ToddAndMargo <toddandma...@zoho.com <mailto:toddandma...@zoho.com>> wrote:

    On 9/28/18 10:42 AM, Curt Tilmes wrote:
     > Indeed we do, we have a special value just for that -- Inf or ∞.

    Inf or ∞ still means (to me) a number too large to represent.
    But, I can't think of another way to say "all of them".


So if I was to ask you what limit I should use to make an iterator that created all of the numbers?

I could set the limit at 2:  1..2 and you would get 2 numbers.
I could set the limit at 1000: 1..1000 and you would get 1000 numbers.

If you wanted all the numbers, where would you stop?  What limit would you use?

We use ∞  :   Try this   .say for 1..∞
It will give you all the numbers starting with 1 that Perl is capable of making (it may take a while...)

Exactly the same for .words.

You can say .words(2) and you get at most 2 words, the limit is 2.
You can say .words(1000) and you get at most 1000 words, the limit is 1000.
(Note you can get less that 1000 -- it isn't saying how many words, it isn't a count.  It is a limit.  it is setting the limit it won't go past.)

If you don't want it to stop, you say .words(∞) or .words(Inf), or, since an infinite limit is the default, just .words() or .words. and it won't stop no matter how many it has already given you until it reaches the end.

Curt



Hi Curt,

I absolutely understand.  I just don't like the wording of Inf
in this case.

https://en.wikipedia.org/wiki/Infinity
   Infinity (symbol: ∞) is a concept describing something
   without any bound or larger than any natural number.

"without any bound" is what it is being used for here.
I see it as "larger than any natural number".  So I
am probably the one at fault.

"Except" this is where I got Perl's definition of it:

https://docs.perl6.org/type/Num#index-entry-Inf_%28definition%29-Inf
     The value Inf is an instance of Num and represents value that's
     too large to represent in 64-bit double-precision floating
     point number

So the manual is describing it as "larger than any natural
[Perl] number", not as "without any bound" .

Time for an RFE on
https://docs.perl6.org/type/Num#index-entry-Inf_%28definition%29-Inf
to add "without any bound" to the verbiage.

Yes I am picking nits.

-T

Reply via email to