Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Incrementing "Infinity" bug (numification, perlnumber, magic increment decrement)

by Anonymous Monk
on Mar 25, 2013 at 07:17 UTC ( #1025237=note: print w/replies, xml ) Need Help??


in reply to Re^2: Incrementing "Infinity" bug (numification, perlnumber, magic increment decrement)
in thread Incrementing "Infinity" bug

It's a bug or at least a design flow.

How do you figure? I think it isn't

So why doesn't Perl do this per default?

You know why, tradition (backwards compatibility ). "barewords" have always been strings

Also style, lowercase constants are unbecoming :p

do we really need to use hacks like 1e9999 to create inf?

We never needed that, use  0+'inf' or  int '-inf' ...

But hey, one of the math modules could export ... or even  use feature 'infinity'; could happen though I don't see the benefit, but what do I know

$ perl -le " for(1..4){ print for \int 'infinity', \int'-infinity' } +" SCALAR(0x99bc74) SCALAR(0x99bc64) SCALAR(0x99bc74) SCALAR(0x99bc64) SCALAR(0x99bc74) SCALAR(0x99bc64) SCALAR(0x99bc74) SCALAR(0x99bc64)

update: nans, infs, and vomit, How to create nan/inf says bigint/bigrat export inf that stringifies to inf

Also note Re^3: nans, infs, and vomit (underlying c-runtime and strtod, atof)

  • Comment on Re^3: Incrementing "Infinity" bug (numification, perlnumber, magic increment decrement)
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: Incrementing "Infinity" bug (numification, perlnumber, magic increment decrement)
by LanX (Archbishop) on Mar 25, 2013 at 12:33 UTC
    > We never needed that,

    I showed a use case producing short, self-explanatory code with the use of inf.

    > use 0+inf or int '-inf' ...

    sure, why not introducing one more level of cryptic workarounds to justify perl's reputation of a line-noise-language instead of having self explanatory constants?

    > update:

    well ... no comment on the fact of an AnoMonk who can update his nodes ...;-)

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      > We never needed that,
      I showed a use case producing short, self-explanatory code with the use of inf.

      But what has that got to do with the whack/hack 1e9999 ?

      $ perl -le " print for 1 .. 0+'Inf'" Range iterator outside integer range at -e line 1.

      sure, why not introducing one more level of cryptic workarounds to justify perl's reputation of a line-noise-language instead of having self explanatory constants?

      you know, I linked to the docs, the explanation, and the inf constant exporters (bigrat/bigint )

      perl is fundamentally what it is, and it works the way it has for over a decade, if you don't like it, don't use it; calling it line-noise and cryptic at every turn is uninspired and uninteresting

      update:

      well ... no comment on the fact of an AnoMonk who can update his nodes ...;-)

      Boring :/

        > perl is fundamentally what it is, and it works the way it has for over a decade, if you don't like it, don't use it; calling it line-noise and cryptic at every turn is uninspired and uninteresting

        good arguments for Perl 4.

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2019-11-15 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (84 votes). Check out past polls.

    Notices?