Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Numerically generate the perl sequence 1, 11, 111, ....

by JavaFan (Canon)
on Oct 12, 2008 at 15:41 UTC ( #716682=note: print w/replies, xml ) Need Help??


in reply to Re^3: Numerically generate the perl sequence 1, 11, 111, ....
in thread Generate the perl sequence 1, 11, 111, ....

One interesting and useful sequence that springs to mind is:
2, 3, 5, 7, 11, 13, ... # Prime numbers.
but with neither differences, nor ratios could one continue the sequence.

Replies are listed 'Best First'.
Re^5: Numerically generate the perl sequence 1, 11, 111, ....
by moritz (Cardinal) on Oct 12, 2008 at 16:07 UTC
    ... nor can it be efficiently computed, which is why I'd leave it out.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://716682]
help
Chatterbox?
[pryrt]: 1nickt, sprintf "%.16e", $v will always give enough precision to see 1 ULP (the smallest fractional part) of a standard 64bit Perl NV*
[pryrt]: (*: for systems where $Config{nvsize}==8 )
[pryrt]: Thus, that's "enough precision" to tell the difference between 1.0 and 1.0+1ULP
[pryrt]: But in what circumstance does your problem arise? When, in Perl, does the integer 1 not work identically to the floating-point NV 1.0000000000000000 e0?

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (15)
As of 2017-05-24 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?