Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Print Number With Implied Decimal Point

by kennethk (Monsignor)
on Apr 18, 2012 at 15:38 UTC ( #965732=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Print Number With Implied Decimal Point
in thread Print Number With Implied Decimal Point

Note that with a properly crafted regex, the timing difference between it and substr is pretty small; limiting the scope of bigint and using the look-ahead regex from Re^2: Print Number With Implied Decimal Point:

Rate regex substr regex2 regex 2926/s -- -78% -80% substr 13087/s 347% -- -11% regex2 14782/s 405% 13% --
Update: see Re^2: Print Number With Implied Decimal Point

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re^3: Print Number With Implied Decimal Point
Download Code
Re^4: Print Number With Implied Decimal Point
by Eliya (Vicar) on Apr 18, 2012 at 15:46 UTC
    the timing difference between it and substr is pretty small

    Yes, sure.  My main point was the side effects of applying use bigint globally (which completely washes out any difference there might be), and not so much to support that substr is faster than regex.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-19 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (72 votes), past polls