@param bool $asInt

@return int|float
497395
public function getCycle($asInt = true)
    {
        $result = ($this->getRyzomMonth() / self::RYZOM_CYCLE_IN_MONTH) + 1;

        return $asInt ? (int) $result : $result;
    }
152082
public function getAspectRatio(): float
    {
        $attrs = $this->getXmlAttrs();

        if (!isset($attrs->viewBox)) {
            return 0;
        }

        list(, , $width, $height) = explode(' ', $attrs->viewBox);

        return $width / $height;
    }
437851
public function getDayOfSeason($asInt = true)
    {
        $value = fmod($this->getRyzomDay(), self::RYZOM_SEASON_IN_DAY) + 1;

        return $asInt ? (int) $value : $value;
    }
539140
def cast_to_number_or_bool(inputstr):
    
    if inputstr.strip().lower() == "true":
        return True
    elif inputstr.strip().lower() == "false":
        return False
    try:
        return int(inputstr)
    except ValueError:
        try:
            return float(inputstr)
        except ValueError:
            return inputstr
605701
public function getAsFloat($column, $default = false, $decimals = null, $point = null, $thousands = null)
  {
    if (is_null($decimals)) {
      $decimals = 2;
    }
    if (is_null($point)) {
      $point = '.';
    }
    if (is_null($thousands)) {
      $thousands = '';
    }
    $v = $this->get($column);

    return $v ? number_format($v, $decimals, $point, $thousands) : $default;
  }
141626
public function getX() : ?float 
    {
        if ( ! $this->hasX()) {
            $this->setX($this->getDefaultX());
        }
        return $this->x;
    }
847654
public static function toFloat($o) : ?float
    {
        $o = self::toNumber($o);

        if (is_numeric($o) === true) {
            return floatval($o);
        }

        return $o;
    }
379186
public function getFloat($key)
    {
        try {
            $result = $this->get(self::FLOAT, $key);
            if (!settype($result, 'float')) {
                return 0.0;
            }
        } catch (\Exception $e) {
            return 0.0;
        }
        return $result;
    }
906931
private function compare_float( $a, $b ) {
		$a = number_format( $a, 4 );
		$b = number_format( $b, 4 );
		if ( 0 === $a - $b ) {
			return 0;
		} elseif ( $a - $b < 0 ) {
			return -1;
		} else {
			return 1;
		}
	}
1148960
public function byteIntToString($int)
    {
        if ($int % 1073741824 == 0) { // 1024 * 1024 * 1024
            return ($int / 1073741824).'G';
        } elseif ($int % 1048576 == 0) { // 1024 * 1024
            return ($int / 1048576).'M';
        } elseif ($int % 1024 == 0) {
            return ($int / 1024).'K';
        }

        return (string) $int;
    }
1221621
public static BigFloat asin(BigFloat x) {
		if (x.isZero())
			return x;
		return x.isNaN() || (!isRangeAbs1(x)) ? NaN :
				x.context.valueOf(BigDecimalMath.asin(x.value, x.context.mathContext));
	}
883522
private function int4Type6($Int)
    {
        if ($Int === 1) {
            return 0;
        }
        $Tail2 = $Int % 100;
        if ($Tail2 > 10 && $Tail2 < 20) {
            return 2;
        }
        if ($Int === 0 || ($Tail2 > 1 && $Tail2 < 11)) {
            return 3;
        }
        return 1;
    }
807737
function _rightRotate($int, $amt)
    {
        $invamt = 32 - $amt;
        $mask = (1 << $invamt) - 1;
        return (($int << $invamt) & 0xFFFFFFFF) | (($int >> $amt) & $mask);
    }
541165
public static function digits($value, $asInt = FALSE, $nullable = TRUE)
	{
		$value = preg_replace('/\D+/', '', (string) $value);
		if ($nullable && !strlen($value)) $value = NULL;

		return $asInt ? self::setTypeInt($value, $nullable) : $value;
	}
407747
public static function get($name, $int = FALSE) {
    	if ($int) {
    		return (isset($_GET[$name]))?(int)$_GET[$name]:0;    
    	} else {
    		return (isset($_GET[$name]))?$_GET[$name]:FALSE;
    	}
    }
427680
public function getIsDecimal( $number = false )
	{
		return	strpos( $number === false ? $this->_value : $number, "." ) !== false &&
				trim( substr( $number === false ? $this->_value : $number, strpos( $number === false ? $this->_value : $number, "." ) + 1 ), "0" );
	}
439522
public function absMin() : float
    {
        $result = 0.0;

        foreach ($this->components as $component) {
            if ($result > $abs = abs($component)) {
                $result = $abs;
            }
        }

        return $result;
    }