in reply to Re^3: Recurring Cycle of Fractions
in thread Recurring Cycle of Fractions
No. Don't try it with 170 but with another, carefully crafted fraction: 102/900
s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Output: 0.113333333333333333333...333: 1#!/usr/bin/perl use Math::BigFloat; Math::BigFloat->div_scale(50); my @values = map { my $i = Math::BigFloat->new( 102 ); scalar $i->bdiv( $_ ); } (900); for (@values) { /\.\d*?(\d+?)\1/; print "$_: $1\n" }
s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
|
---|
In Section
Seekers of Perl Wisdom