Returns the number of significant figures in a string number.
@param string $n Decimal number
@return int number of sigfigs
13415
public function getSigFigs($n)
    {
        $n = ltrim($n, '0+-');
        $dp = strpos($n, '.'); // decimal position
        if ($dp === false) {
            $sigfigs = strlen(rtrim($n, '0'));
        } else {
            $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character
            if ($dp !== 0) {
                $sigfigs--;
            }
        }
        return $sigfigs;
    }
1158838
public static String string(double n) {
        if (Double.isInfinite(n)) {
            return (n > 0) ? "+inf" : "-inf";
        }
        return Double.toString(n);
    }
331101
public function first($n)
    {
        $first = '';

        if ($n > 0)
        {
            $first = UTF8::substr
            (
                $this->scalarString,
                0,
                $n,
                $this->encoding
            );
        }

        return $this->newSelf($first);
    }
681272
public static function plural_type(int $n) : int
    {
        return ($n%10==1 && $n%100!=11 ? 0 : ($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2));
    }
308668
protected static function c(int $n) : float
    {
        if ($n <= 1) {
            return 1.;
        }
        
        return 2. * (log($n - 1) + M_EULER) - 2. * ($n - 1) / $n;
    }
1134511
public function read($n)
    {
        if ($n <= 0) {
            return '';
        }
        if (!isset($this->bev)) {
            return false;
        }
        $read = $this->bev->read($n);
        if ($read === null) {
            return false;
        }
        return $read;
    }
754492
public function nth( $nth ) {

		if ( empty( $nth ) ) {
			$nth = 2;
		}

		$offset   = 0;
		$negative = false;

		if ( 'even' === $nth ) {
			$nth = 2;
		} elseif ( 'odd' === $nth ) {
			$negative = true;
			$nth      = 2;
		} elseif ( false !== strpos( $nth, '+' ) ) {
			$nth = explode( '+', $nth );

			if ( isset( $nth[1] ) ) {
				$offset += (int) trim( $nth[1] );
			}

			$nth = (int) trim( $nth[0], ' n' );
		} elseif ( false !== strpos( $nth, '-' ) ) {
			$nth = explode( '-', $nth );

			if ( isset( $nth[1] ) ) {
				$offset -= (int) trim( $nth[1] );
			}

			$nth = (int) trim( $nth[0], ' n' );
		}//end if

		$nth    = (int) $nth;
		$offset = (int) $offset;

		if ( 0 === ( ( $this->row_number % $nth ) + $offset ) ) {
			return ( $negative ? false : true );
		}

		return ( $negative ? true : false );
	}
1069782
public static function number(float $n, int $precision = 0): string
    {
        return self::$locale->number(round($n, $precision));
    }
1270597
public function getNossoNumeroBoleto()
    {
        $nn = $this->getNossoNumero() . CalculoDV::bbNossoNumero($this->getNossoNumero());
        return strlen($nn) < 17 ? substr_replace($nn, '-', -1, 0) : $nn;
    }
79642
public static function ODD($number) {
		$number	= PHPExcel_Calculation_Functions::flattenSingleValue($number);

		if (is_null($number)) {
			return 1;
		} elseif (is_bool($number)) {
			$number = (int) $number;
		}

		if (is_numeric($number)) {
			$significance = self::SIGN($number);
			if ($significance == 0) {
				return 1;
			}

			$result = self::CEILING($number,$significance);
			if ($result == self::EVEN($result)) {
				$result += $significance;
			}

			return (int) $result;
		}
		return PHPExcel_Calculation_Functions::VALUE();
	}
1203290
public function read($n)
    {
        if (0 === $n) {
            return '';
        }

        $remaining = ($n - $this->length) + $this->position;

        while ($remaining > 0) {
            //$this->io->wait();
            if ($this->io->shouldEnableCrypto()) {
                $new = $this->io->read($remaining);
            } else {
                $new = $this->io->readChunk($remaining);
            }
            $this->bytes .= $new;
            $remaining -= strlen($new);
        }

        $this->length = strlen($this->bytes);
        $data = substr($this->bytes, $this->position, $n);
        $this->position += $n;

        return $data;
    }
741199
private function roundDigit(Number $number)
    {
        if ($number->isCloserToNext()) {
            return bcadd(
                (string) $number,
                $number->getIntegerRoundingMultiplier(),
                0
            );
        }

        return bcadd((string) $number, '0', 0);
    }
259806
private function numberToNumerals($number, array $numerals)
    {
        $string = '';

        while ($number > 0) {
            foreach ($numerals as $n => $t) {
                if ($number >= $n) {
                    $string .= $t;
                    $number -= $n;
                    break;
                }
            }
        }

        return $string;
    }
1020558
public function numRows(): ?int
	{
		$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
		$output = [];

		if (preg_match($regex, $this->lastQuery, $output) > 0)
		{
			$stmt = $this->query("SELECT COUNT(*) FROM {$output[1]}");
			return (int) $stmt->fetchColumn();
		}

		return NULL;
	}
1097675
public function first($n) {
        $stringy = self::create($this->str, $this->encoding);

        if ($n < 0) {
            $stringy->str = '';
        } else {
            return $stringy->substr(0, $n);
        }

        return $stringy;
    }
1373939
private function select_string($n) {
        $string = $this->get_plural_forms();
        $string = str_replace('nplurals', "\$total", $string);
        $string = str_replace("n", $n, $string);
        $string = str_replace('plural', "\$plural", $string);

        $total = 0;
        $plural = 0;

        eval("$string");
        if ($plural >= $total) $plural = $total - 1;
        return $plural;
    }
1047241
public static String stringFor(int n)
    {
        switch (n)
        {
            case CUDNN_DATA_FLOAT: return "CUDNN_DATA_FLOAT";
            case CUDNN_DATA_DOUBLE: return "CUDNN_DATA_DOUBLE";
            case CUDNN_DATA_HALF: return "CUDNN_DATA_HALF";
            case CUDNN_DATA_INT8: return "CUDNN_DATA_INT8";
            case CUDNN_DATA_INT32: return "CUDNN_DATA_INT32";
            case CUDNN_DATA_INT8x4: return "CUDNN_DATA_INT8x4";
            case CUDNN_DATA_UINT8: return "CUDNN_DATA_UINT8";
            case CUDNN_DATA_UINT8x4: return "CUDNN_DATA_UINT8x4";
        }
        return "INVALID cudnnDataType: "+n;
    }