Returns the Golden Ration, also named Phi.
@return Decimal
552586
public static function goldenRatio(): Decimal
    {
        if (null === self::$GoldenRatio) {
            self::$GoldenRatio = Decimal::fromString(
                "1.61803398874989484820458683436564"
            );
        }
        return self::$GoldenRatio;
    }
38468
public function NiceDecimalPoint()
    {
        $currencySymbol = Currency::config()->get('currency_symbol');
        $decimalPoint = Currency::config()->get('decimal_point');
        $thousandSeparator = Currency::config()->get('thousand_seperator');
        $val = $currencySymbol . number_format(abs($this->owner->value), 2, $decimalPoint, $thousandSeparator);
        if ((double)$this->owner->value === (double)0) {
            return _t('CurrencyExtension.FREE', 'Free');
        } elseif ((double)$this->owner->value < 0) {
            return "($val)";
        } else {
            return $val;
        }
    }
500792
public function getIntegerPart()
	{
		if ( ! $this->getIsDecimal() ) return $this->_value;
		return substr( $this->_value, 0, strpos( $this->_value, "." ) );
	}
880431
public function getProportionalVatPercent()
    {
        $dTotalSum = 0;

        foreach ($this->_aList as $oPrice) {
            $dTotalSum += $oPrice->getNettoPrice();
        }

        $dProportionalVat = 0;

        foreach ($this->_aList as $oPrice) {
            if ($dTotalSum > 0) {
                $dProportionalVat += $oPrice->getNettoPrice() / $dTotalSum * $oPrice->getVat();
            }
        }

        return $dProportionalVat;
    }
1038803
public function getPercentagePartial()
    {
        $total = $this->getTotal();

        return round((($this->score->getValid() + $this->score->getPartial())/$total) * 100);
    }
1037499
public function getAmountCents()
    {
        if ($this->getNotForPayment()) {
            return 'XX';
        }
        $amount = $this->getAmount();
        $francs = intval($amount);
        $cents = round(($amount - $francs) * 100);
        return str_pad($cents, 2, '0', STR_PAD_LEFT);
    }
133769
function() {

		var EPS = 0.000001;
		this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );

		return this;

	}
307359
public static function latiso($eccent, $phi, $sinphi)
    {
        if (abs($phi) > M_PI_2) {
            return +NaN;
        }

        if ($phi == M_PI_2) {
            return INF;
        }

        if ($phi == -1.0 * M_PI_2) {
            return -1.0 * INF;
        }

        $con = $eccent * $sinphi;

        return log(tan((M_PI_2 + $phi) / 2.0 ) )
            + $eccent * log( (1.0 - $con) / (1.0 + $con)) / 2.0;
    }
560356
public function getPercentage($round = true)
    {
        if ($this->translated === 0 || $this->total === 0) {
            $result = $round ? 0 : 0.0;
        } elseif ($this->translated === $this->total) {
            $result = $round ? 100 : 100.0;
        } else {
            $result = $this->translated * 100.0 / $this->total;
            if ($round) {
                $result = max(1, min(99, (int) round($result)));
            }
        }

        return $result;
    }
626396
public function getHelpfulness()
    {
        if ($this->hits + $this->misses === 0) {
            return 0.00;
        }

        return number_format(($this->hits / ($this->hits + $this->misses)) * 100, 2);
    }
372133
public double phi() {
    long latestHeartbeat = history.latestHeartbeatTime();
    DescriptiveStatistics samples = history.samples();
    if (samples.getN() < minSamples) {
      return 0.0;
    }
    return computePhi(samples, latestHeartbeat, System.currentTimeMillis());
  }
1109156
public static function pi(): Decimal
    {
        if (null === self::$PI) {
            self::$PI = Decimal::fromString(
                "3.14159265358979323846264338327950"
            );
        }
        return self::$PI;
    }
900403
public function getRatio()
    {
        $total = $this->score->getValid() +
            $this->score->getPartial() +
            $this->score->getNotValid();

        return $this->score->getValid() == 0 ? 0 : (float) number_format($this->score->getValid()/$total, 2);
    }
208697
public static function convert($number, $from, $to, $ratio = 0.75){
		switch($from){
			case 'in': switch($to){
				case 'in': return $number;
				case 'cm': return $number * 2.54;
				case 'mm': return $number * 25.4;
				case 'pt': return $number * 72;
				case 'pc': return $number * 6;
				case 'px': return $number * 72 * $ratio;
			}
			case 'cm': switch($to){
				case 'in': return $number / 2.54;
				case 'cm': return $number;
				case 'mm': return $number / 10;
				case 'pt': return $number * 72 / 2.54;
				case 'pc': return $number * 6 / 2.54;
				case 'px': return $number * 72 * $ratio / 2.54;
			}
			case 'mm': switch($to){
				case 'in': return $number / 25.4;
				case 'cm': return $number * 10;
				case 'mm': return $number;
				case 'pt': return $number * 72 / 25.4;
				case 'pc': return $number * 6 / 25.4;
				case 'px': return $number * 72 * $ratio / 25.4;
			}
			case 'pt': switch($to){
				case 'in': return $number / 72;
				case 'cm': return $number * 2.54  / 72;
				case 'mm': return $number * 25.4 / 72;
				case 'pt': return $number;
				case 'pc': return $number * 12;
				case 'px': return $number * 72 * $ratio  / 72;
			}
			case 'pc': switch($to){
				case 'in': return $number / 6;
				case 'cm': return $number * 2.54  / 6;
				case 'mm': return $number * 25.4 / 6;
				case 'pt': return $number / 12;
				case 'pc': return $number;
				case 'px': return $number * 72 * $ratio  / 6;
			}
			case 'px': switch($to){
				case 'in': return $number / 72 * $ratio;
				case 'cm': return $number * 2.54 / 72 * $ratio;
				case 'mm': return $number * 25.4 / 72 * $ratio;
				case 'pt': return $number * $ratio;
				case 'pc': return $number * 6 / 72 * $ratio;
				case 'px': return $number;
			}
		}
		
		throw new \Exception("Invalid conversion from $from to $to with a value of $number");
	}
1111863
public function getAmount() : ?float 
    {
        if ( ! $this->hasAmount()) {
            $this->setAmount($this->getDefaultAmount());
        }
        return $this->amount;
    }
1173898
private BigDecimal getSunTrueLongitude(BigDecimal meanAnomaly) {
        BigDecimal sinMeanAnomaly = new BigDecimal(Math.sin(convertDegreesToRadians(meanAnomaly).doubleValue()));
        BigDecimal sinDoubleMeanAnomaly = new BigDecimal(Math.sin(multiplyBy(convertDegreesToRadians(meanAnomaly), BigDecimal.valueOf(2))
                .doubleValue()));

        BigDecimal firstPart = meanAnomaly.add(multiplyBy(sinMeanAnomaly, new BigDecimal("1.916")));
        BigDecimal secondPart = multiplyBy(sinDoubleMeanAnomaly, new BigDecimal("0.020")).add(new BigDecimal("282.634"));
        BigDecimal trueLongitude = firstPart.add(secondPart);

        if (trueLongitude.doubleValue() > 360) {
            trueLongitude = trueLongitude.subtract(BigDecimal.valueOf(360));
        }
        return setScale(trueLongitude);
    }
553529
public function getBalance(): float
    {
        $this->authenticator->authenticate();

        return (float) $this->soapClient->__soapCall('GetCreditBalance', [])
            ->GetCreditBalanceResult;
    }