| 1 | # Copyright 2011, 2012, 2013, 2014, 2016, 2019, 2020 Kevin Ryde | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # This file is part of Math-NumSeq. | ||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||
| 5 | # Math-NumSeq is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 6 | # it under the terms of the GNU General Public License as published by the | ||||||||||||||||||||||||||||
| 7 | # Free Software Foundation; either version 3, or (at your option) any later | ||||||||||||||||||||||||||||
| 8 | # version. | ||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||
| 10 | # Math-NumSeq is distributed in the hope that it will be useful, but | ||||||||||||||||||||||||||||
| 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||||||||||||||||||||||||||||
| 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||||||||||||||||||||||||||
| 13 | # for more details. | ||||||||||||||||||||||||||||
| 14 | # | ||||||||||||||||||||||||||||
| 15 | # You should have received a copy of the GNU General Public License along | ||||||||||||||||||||||||||||
| 16 | # with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | package Math::NumSeq::ReRound; | ||||||||||||||||||||||||||||
| 19 | 2 | ▶ | use 5.004; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use POSIX 'ceil'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use List::Util 'max'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 2 | ▶ | use vars '$VERSION','@ISA'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 25 | 2 | $VERSION = 75; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 2 | ▶ | use Math::NumSeq; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 28 | 2 | ▶ | use Math::NumSeq::Base::IterateIth; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 29 | 2 | @ISA = ('Math::NumSeq::Base::IterateIth', | |||||||||||||||||||||||||||
| 30 | 'Math::NumSeq'); | ||||||||||||||||||||||||||||
| 31 | 2 | *_is_infinite = \&Math::NumSeq::_is_infinite; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | # uncomment this to run the ### lines | ||||||||||||||||||||||||||||
| 34 | #use Smart::Comments; | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | # use constant name => Math::NumSeq::__('Repeated Rounding'); | ||||||||||||||||||||||||||||
| 37 | 2 | ▶ | use constant description => Math::NumSeq::__('Repeated rounding up to multiple of N, N-1, ..., 1.'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 38 | 2 | ▶ | use constant values_min => 1; # at i=1 | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 39 | 2 | ▶ | use constant i_start => 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 40 | 2 | ▶ | use constant characteristic_increasing => 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 41 | 2 | ▶ | use constant characteristic_integer => 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 2 | ▶ | use constant parameter_info_array => | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 44 | [ | ||||||||||||||||||||||||||||
| 45 | { name => 'extra_multiples', | ||||||||||||||||||||||||||||
| 46 | display => Math::NumSeq::__('Extra Multiples'), | ||||||||||||||||||||||||||||
| 47 | type => 'integer', | ||||||||||||||||||||||||||||
| 48 | default => '0', | ||||||||||||||||||||||||||||
| 49 | minimum => 0, | ||||||||||||||||||||||||||||
| 50 | width => 2, | ||||||||||||||||||||||||||||
| 51 | description => Math::NumSeq::__('Extra multiples to round up at each stage.'), | ||||||||||||||||||||||||||||
| 52 | }, | ||||||||||||||||||||||||||||
| 53 | 2 | ]; | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 56 | # cf A007952 sieve+1 | ||||||||||||||||||||||||||||
| 57 | # A099361 sieve by primes | ||||||||||||||||||||||||||||
| 58 | # A099204 sieve by primes | ||||||||||||||||||||||||||||
| 59 | # A099207 sieve by primes | ||||||||||||||||||||||||||||
| 60 | # A099243 sieve by primes | ||||||||||||||||||||||||||||
| 61 | # A002960 square sieve | ||||||||||||||||||||||||||||
| 62 | # | ||||||||||||||||||||||||||||
| 63 | # A056533 sieve out even every 2nd,4th,6th,etc | ||||||||||||||||||||||||||||
| 64 | # A039672 sieve fibonacci style i+j prev terms | ||||||||||||||||||||||||||||
| 65 | # A056530 Flavius Josephus after 2nd round | ||||||||||||||||||||||||||||
| 66 | # A056531 Flavius Josephus after 4th round | ||||||||||||||||||||||||||||
| 67 | # A119446 cf A100461 | ||||||||||||||||||||||||||||
| 68 | # | ||||||||||||||||||||||||||||
| 69 | # A113749 k multiples | ||||||||||||||||||||||||||||
| 70 | # | ||||||||||||||||||||||||||||
| 71 | my @oeis_anum | ||||||||||||||||||||||||||||
| 72 | 2 | = ( | |||||||||||||||||||||||||||
| 73 | # OEIS-Catalogue array begin | ||||||||||||||||||||||||||||
| 74 | 'A002491', # # Mancala stones | ||||||||||||||||||||||||||||
| 75 | 'A000960', # extra_multiples=1 # Flavius Josephus | ||||||||||||||||||||||||||||
| 76 | 'A112557', # extra_multiples=2 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 77 | 'A112558', # extra_multiples=3 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 78 | 'A113742', # extra_multiples=4 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 79 | 'A113743', # extra_multiples=5 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 80 | 'A113744', # extra_multiples=6 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 81 | 'A113745', # extra_multiples=7 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 82 | 'A113746', # extra_multiples=8 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 83 | 'A113747', # extra_multiples=9 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 84 | 'A113748', # extra_multiples=10 # more Mancala stones ... | ||||||||||||||||||||||||||||
| 85 | # OEIS-Catalogue array end | ||||||||||||||||||||||||||||
| 86 | ); | ||||||||||||||||||||||||||||
| 87 | 1 | ▶ | sub oeis_anum { | ||||||||||||||||||||||||||
|
Subroutine
oeis_anum: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 88 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||
| 89 | 1 | return $oeis_anum[$self->{'extra_multiples'}]; | |||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 180 | ▶ | sub ith { | ||||||||||||||||||||||||||
|
Subroutine
ith: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||
| 96 | 180 | my ($self, $i) = @_; | |||||||||||||||||||||||||||
| 97 | ### ReRound ith(): $i | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 180 | ▶ | if (_is_infinite($i)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | 0 | return $i; # don't loop forever if $i is +infinity | |||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | 180 | my $extra_multiples = $self->{'extra_multiples'}; | |||||||||||||||||||||||||||
| 104 | ### $extra_multiples | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 180 | ▶ | for (my $m = $i-1; $m >= 1; $m--) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 107 | ### add: (-$i % $m) + $extra_multiples*$m | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 5489 | $i += (-$i % $m) + $extra_multiples*$m; | |||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | 180 | return $i; | |||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | # 1,3,7,13,19 | ||||||||||||||||||||||||||||
| 115 | # 2->2+1=3 | ||||||||||||||||||||||||||||
| 116 | # 3->4+2=6->6+1=7 | ||||||||||||||||||||||||||||
| 117 | # 4->6+m3=9->10+m2=12->12+m1=13 | ||||||||||||||||||||||||||||
| 118 | # | ||||||||||||||||||||||||||||
| 119 | # next = prev + (-prev mod m) + k*m | ||||||||||||||||||||||||||||
| 120 | # next-k*m = prev + (-prev mod m) | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | 29 | ▶ | sub pred { | ||||||||||||||||||||||||||
|
Subroutine
pred: called CC=8 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||
| 123 | 29 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 124 | ### ReRound pred(): $value | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | 29 | my $extra_multiples = $self->{'extra_multiples'}; | |||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | 29 | ▶ | if (_is_infinite($value)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 129 | 0 | return undef; | |||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||
| 131 | 29 | ▶ | if ($value <= 1 || $value != int($value)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$value <= 1 or $value != int $value
MC/DC100%2/2
$value <= 1 or $value != int $value
$value <= 1
$value != int $value
Truth table100%3/3
A or B
A= $value <= 1B= $value != int $value
| |||||||||||||||||||||||||||||
| 132 | 13 | return ($value == 1); | |||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | # special case m=1 stepping down to an even number | ||||||||||||||||||||||||||||
| 136 | 16 | ▶ | if (($value -= $extra_multiples) % 2) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 137 | 5 | return 0; | |||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | 11 | my $m = 2; | |||||||||||||||||||||||||||
| 141 | 11 | ▶ | while ($value > $m) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 142 | ### at: "value=$value m=$m" | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | 21 | ▶ | if (($value -= $extra_multiples*$m) <= 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 145 | ### no, negative: $value | ||||||||||||||||||||||||||||
| 146 | 0 | return 0; | |||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||
| 148 | ### subtract to: "value=$value" | ||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | ### rem: "modulus=".($m+1)." rem ".($value%($m+1)) | ||||||||||||||||||||||||||||
| 151 | 21 | my $rem; | |||||||||||||||||||||||||||
| 152 | 21 | ▶ | if (($rem = ($value % ($m+1))) == $m) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 153 | ### no, remainder: "rem=$rem modulus=".($m+1) | ||||||||||||||||||||||||||||
| 154 | 1 | return 0; | |||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | 20 | $value -= $rem; | |||||||||||||||||||||||||||
| 158 | 20 | $m++; | |||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | ### final ... | ||||||||||||||||||||||||||||
| 162 | ### $value | ||||||||||||||||||||||||||||
| 163 | ### $m | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 10 | return ($value == $m); | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | # # v1.02 for leading underscore | ||||||||||||||||||||||||||||
| 169 | 2 | ▶ | use constant 1.02 _PI => 4*atan2(1,1); # similar to Math::Complex pi() | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | # value = m*1+m*2+m*3+...+m*i | ||||||||||||||||||||||||||||
| 172 | # value = m*i*(i+1)/2 | ||||||||||||||||||||||||||||
| 173 | # i*i + i - 2v/m = 0 | ||||||||||||||||||||||||||||
| 174 | # i = (-1 + sqrt(1 + 4*2v/m)) / 2 | ||||||||||||||||||||||||||||
| 175 | # = -1/2 + sqrt(1 + 4*2v/m)/2 | ||||||||||||||||||||||||||||
| 176 | # = -1/2 + sqrt(4 + 2v/m) | ||||||||||||||||||||||||||||
| 177 | # i -> sqrt(2v/m) | ||||||||||||||||||||||||||||
| 178 | # | ||||||||||||||||||||||||||||
| 179 | # as extra_multiples dominates the estimate changes from | ||||||||||||||||||||||||||||
| 180 | # extra_multiples==0 est = sqrt(pi*value) | ||||||||||||||||||||||||||||
| 181 | # up to | ||||||||||||||||||||||||||||
| 182 | # extra_multiples==m large est = sqrt(2*value/m) | ||||||||||||||||||||||||||||
| 183 | # | ||||||||||||||||||||||||||||
| 184 | # What formula that progressively morphs pi to 2/m ? | ||||||||||||||||||||||||||||
| 185 | # | ||||||||||||||||||||||||||||
| 186 | 15 | ▶ | sub value_to_i_estimate { | ||||||||||||||||||||||||||
|
Subroutine
value_to_i_estimate: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||
| 187 | 15 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 188 | 15 | ▶ | if ($value < 0) { return 0; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | 9 | ▶ | if ($self->{'extra_multiples'} == 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 191 | # use sqrt(pi)~=296/167 to preserve Math::BigInt | ||||||||||||||||||||||||||||
| 192 | 9 | return int( (sqrt(int($value)) * 296) / 167); | |||||||||||||||||||||||||||
| 193 | } else { | ||||||||||||||||||||||||||||
| 194 | 0 | return int(sqrt(int (2 * $value / $self->{'extra_multiples'}))); | |||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | # return int(sqrt(int ($value * _PI/($self->{'extra_multiples'}+1)**2)) | ||||||||||||||||||||||||||||
| 197 | # + ($self->{'extra_multiples'} > 0 | ||||||||||||||||||||||||||||
| 198 | # ? -0.5 + sqrt(4 + 2*$value/$self->{'extra_multiples'}) | ||||||||||||||||||||||||||||
| 199 | # : 0)); | ||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | # # large extra_multiples | ||||||||||||||||||||||||||||
| 205 | # return int(sqrt(int (2 * $value | ||||||||||||||||||||||||||||
| 206 | # / ($self->{'extra_multiples'}+1)))); | ||||||||||||||||||||||||||||
| 207 | # | ||||||||||||||||||||||||||||
| 208 | # return int(sqrt(int (($value * 355) | ||||||||||||||||||||||||||||
| 209 | # / (113 * ($self->{'extra_multiples'}+1))))); | ||||||||||||||||||||||||||||
| 210 | # | ||||||||||||||||||||||||||||
| 211 | # | ||||||||||||||||||||||||||||
| 212 | # # extra_multiples==14 | ||||||||||||||||||||||||||||
| 213 | # return int(sqrt(int (_PI * $value)) * 429/2048); # 429=13*11*3 | ||||||||||||||||||||||||||||
| 214 | # | ||||||||||||||||||||||||||||
| 215 | # # extra_multiples==12 | ||||||||||||||||||||||||||||
| 216 | # return int(sqrt(int (_PI * $value)) * 462/2048); # 231/1024) # 11*7*3=231 | ||||||||||||||||||||||||||||
| 217 | # | ||||||||||||||||||||||||||||
| 218 | # # extra_multiples==10 | ||||||||||||||||||||||||||||
| 219 | # return int(sqrt(int (_PI * $value))) * 126/512; # 63/256; # 7*3*2=126 | ||||||||||||||||||||||||||||
| 220 | # | ||||||||||||||||||||||||||||
| 221 | # # extra_multiples==8 | ||||||||||||||||||||||||||||
| 222 | # return int(sqrt(int (_PI * $value))) * 35/128; # 7*5=35 | ||||||||||||||||||||||||||||
| 223 | # | ||||||||||||||||||||||||||||
| 224 | # # extra_multiples==6 | ||||||||||||||||||||||||||||
| 225 | # return int(sqrt(int (_PI * $value))) * 10/32; # 5/16 # 5*2=10 | ||||||||||||||||||||||||||||
| 226 | # | ||||||||||||||||||||||||||||
| 227 | # # extra_multiples==4 | ||||||||||||||||||||||||||||
| 228 | # return int(sqrt(int (_PI * $value))) * 3/8; | ||||||||||||||||||||||||||||
| 229 | # | ||||||||||||||||||||||||||||
| 230 | # # extra_multiples==2 | ||||||||||||||||||||||||||||
| 231 | # return int(sqrt(int (_PI * $value))) * 1/2; | ||||||||||||||||||||||||||||
| 232 | # | ||||||||||||||||||||||||||||
| 233 | # # extra_multiples==0 | ||||||||||||||||||||||||||||
| 234 | # return int(sqrt(int (_PI * $value))) * 1/1; | ||||||||||||||||||||||||||||
| 235 | # | ||||||||||||||||||||||||||||
| 236 | # 2 1 | ||||||||||||||||||||||||||||
| 237 | # 4 11 | ||||||||||||||||||||||||||||
| 238 | # 6 1010 | ||||||||||||||||||||||||||||
| 239 | # 8 100011 | ||||||||||||||||||||||||||||
| 240 | # 10 1111110 | ||||||||||||||||||||||||||||
| 241 | # 12 111001110 | ||||||||||||||||||||||||||||
| 242 | # 14 110101101 | ||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | # | ||||||||||||||||||||||||||||
| 245 | # | ||||||||||||||||||||||||||||
| 246 | # # extra_multiples==11 | ||||||||||||||||||||||||||||
| 247 | # return int(sqrt(int (1/_PI * $value)) * 1024/1386); # 512/693); | ||||||||||||||||||||||||||||
| 248 | # | ||||||||||||||||||||||||||||
| 249 | # # extra_multiples==9 | ||||||||||||||||||||||||||||
| 250 | # return int(sqrt(int (1/_PI * $value)) * 256/315); | ||||||||||||||||||||||||||||
| 251 | # | ||||||||||||||||||||||||||||
| 252 | # # extra_multiples==7 | ||||||||||||||||||||||||||||
| 253 | # return int(sqrt(int (1/_PI * $value)) * 64/70); # 32/35; | ||||||||||||||||||||||||||||
| 254 | # | ||||||||||||||||||||||||||||
| 255 | # # extra_multiples==5 | ||||||||||||||||||||||||||||
| 256 | # return int(sqrt(int (1/_PI * $value))) * 16/15; | ||||||||||||||||||||||||||||
| 257 | # | ||||||||||||||||||||||||||||
| 258 | # # extra_multiples==3 | ||||||||||||||||||||||||||||
| 259 | # return int(sqrt(int (1/_PI * $value))) * 4/3; | ||||||||||||||||||||||||||||
| 260 | # | ||||||||||||||||||||||||||||
| 261 | # # extra_multiples==1 | ||||||||||||||||||||||||||||
| 262 | # return int(sqrt(int (1/_PI * $value ))) * 2/1; | ||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||
| 266 | 2 | 1; | |||||||||||||||||||||||||||
| 267 | __END__ | ||||||||||||||||||||||||||||