<?php
class Rast {
protected $sonuc, $ciz, $mikro, $sn, $f, $m, $tam;
public function gele($sayi2=100,$sayi1=0,$sayi=0, $mutlak=true, $ciz=false) {
$sayi2++;
$this->ciz = microtime();
list($this->mikro, $this->sn) = explode(" ", $this->ciz);
$this->ciz = ' - '.$this->ciz;
$this->f = '';
$this->m = 1;
if ($sayi > 0) {$sayi2--; $this->f = '.'.$this->gele(pow(10, $sayi));}
if ($ciz === false) { $this->ciz = '';}
if ($mutlak === false) { $this->m = $this->gele(2) == 0 ? -1 : 1; }
$this->mikro = pow($this->mikro, 2) + $this->mikro +41;
$this->sn = pow($this->sn, 2) + $this->sn +41;
$this->tam = strlen($sayi2) +substr($this->mikro, 0, 2) +2;
$this->sonuc = sprintf("%.{$this->tam}f", ($this->mikro/$this->sn));
$this->sonuc = ((((substr($this->sonuc, (strlen($sayi2) > 3 ? (5+strlen($sayi2))*(-1) : -5)) % ($sayi2-$sayi1)) + $sayi1).$this->f)*$this->m).$this->ciz;
return $this->sonuc;
}
}
$rast = new Rast();
echo $rast->gele(5);
echo "<br>";
echo $rast->gele(15, 4);
echo "<br>";
echo $rast->gele(15, 0, 3);
echo "<br>";
echo $rast->gele(15, 4, 3);
echo "<br>";
echo $rast->gele(15, 0, 0, false);
echo "<br>";
echo $rast->gele(15, 0, 3, false);
echo "<br>";
echo $rast->gele(15, 9, 0, false);
echo "<br>";
echo $rast->gele(15, 9, 0, false, true);
echo "<br>";
echo $rast->gele(15, 9, 0, true, true);
echo "<br>";
echo $rast->gele(15, 0, 3, false, true);
echo "<br>";
?>