@param int $num

@return string
@throws NumberToWordsException
430998
protected function toWords($num)
    {
        $neg = 0;
        $ret = [];

        /**
         * Negative ?
         */
        if ($num < 0) {
            $ret[] = $this->minus;
            $num = -$num;
            $neg = 1;
        }

        /**
         * Removes leading zeros, spaces, decimals etc.
         * Adds thousands separator.
         */
        $num = number_format($num, 0, '.', '.');

        /**
         * Testing Zero
         */
        if ($num == 0) {
            return 'zero';
        }

        /**
         * Breaks into chunks of 3 digits.
         * Reversing array to process from right to left.
         */
        $chunks = array_reverse(explode(".", $num));

        /**
         * Looping through the chunks
         */
        foreach ($chunks as $index => $chunk) {
            /**
             * Testing Range
             */
            if (!array_key_exists($index, self::$exponent)) {
                throw new NumberToWordsException('Number out of range.');
            }

            /**
             * Testing Zero
             */
            if ($chunk == 0) {
                continue;
            }

            /**
             * Testing plural of exponent
             */
            if ($chunk > 1) {
                $exponent = str_replace('ão', 'ões', self::$exponent[$index]);
            } else {
                $exponent = self::$exponent[$index];
            }

            /**
             * Adding exponent
             */
            $ret[] = $exponent;

            /**
             * Actual Number
             */
            $word = array_filter($this->parseChunk($chunk));
            $ret[] = implode($this->separator, $word);
        }

        /**
         * In Brazilian Portuguese the last chunck must be separated under
         * special conditions.
         */
        if ((count($ret) > 2 + $neg)
            && $this->mustSeparate($chunks)
        ) {
            $ret[1 + $neg] = trim($this->separator . $ret[1 + $neg]);
        }

        $ret = array_reverse(array_filter($ret));

        return implode(' ', $ret);
    }
423216
function NUM() {
        var _parser = SEQ(OPT('-'), OR('0', SEQ(RANGE('1', '9'), REPEAT(DIGIT()))), OPT(SEQ('.', REPEAT(DIGIT(), 1))), OPT(SEQ(OR('e', 'E'), OPT(OR('+', '-')), REPEAT(DIGIT(), 1))));

        return _make_alias('NUM', paka.P.NUM, _parser);
    }
799404
protected function toWords($num = 0)
    {
        $ret = [];

        $ret_minus = '';

        // check if $num is a valid non-zero number
        if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) {
            return $this->zero;
        }

        // add a minus sign
        if (substr($num, 0, 1) == '-') {
            $ret_minus = $this->minus . $this->wordSeparator;

            $num = substr($num, 1);
        }

        // strip excessive zero signs
        $num = ltrim($num, '0');

        // split $num to groups of three-digit numbers
        $num_groups = $this->splitNumber($num);

        $sizeof_numgroups = count($num_groups);

        // go through the groups in reverse order, so that the last group could be determined
        for ($i = $sizeof_numgroups - 1, $j = 1; $i >= 0; $i--, $j++) {
            if (!isset($ret[$j])) {
                $ret[$j] = '';
            }

            // what is the corresponding exponent for the current group
            $pow = $sizeof_numgroups - $i;

            // skip processment for empty groups
            if ($num_groups[$i] != '000') {
                if ($num_groups[$i] > 1) {
                    if ($pow == 1) {
                        $ret[$j] .= $this->showDigitsGroup(
                            $num_groups[$i],
                            0,
                            !$this->lastAnd && $i
                        ) . $this->wordSeparator;
                        $ret[$j] .= self::$exponent[($pow - 1) * 3];
                    } elseif ($pow == 2) {
                        $ret[$j] .= $this->showDigitsGroup(
                            $num_groups[$i],
                            -1,
                            !$this->lastAnd && $i
                        ) . $this->wordSeparator;
                        $ret[$j] .= self::$miscStrings['hiliadi'] . $this->wordSeparator;
                    } else {
                        $ret[$j] .= $this->showDigitsGroup(
                            $num_groups[$i],
                            1,
                            !$this->lastAnd && $i
                        ) . $this->wordSeparator;
                        $ret[$j] .= self::$exponent[($pow - 1) * 3] . $this->pluralSuffix . $this->wordSeparator;
                    }
                } else {
                    if ($pow == 1) {
                        $ret[$j] .= $this->showDigitsGroup(
                            $num_groups[$i],
                            0,
                            !$this->lastAnd && $i
                        ) . $this->wordSeparator;
                    } elseif ($pow == 2) {
                        $ret[$j] .= self::$exponent[($pow - 1) * 3] . $this->wordSeparator;
                    } else {
                        $ret[$j] .= self::$digits[1][1] . $this->wordSeparator . self::$exponent[($pow - 1) * 3] . $this->wordSeparator;
                    }
                }
            }
        }

        return $ret_minus . rtrim(implode('', array_reverse($ret)), $this->wordSeparator);
    }
648557
public static function dec2roman($num)
    {

        static $ones = array("", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix");
        static $tens = array("", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc");
        static $hund = array("", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm");
        static $thou = array("", "m", "mm", "mmm");

        if (!is_numeric($num)) {
            throw new Exception("dec2roman() requires a numeric argument.");
        }

        if ($num > 4000 || $num < 0) {
            return "(out of range)";
        }

        $num = strrev((string)$num);

        $ret = "";
        switch (mb_strlen($num)) {
            /** @noinspection PhpMissingBreakStatementInspection */
            case 4:
                $ret .= $thou[$num[3]];
            /** @noinspection PhpMissingBreakStatementInspection */
            case 3:
                $ret .= $hund[$num[2]];
            /** @noinspection PhpMissingBreakStatementInspection */
            case 2:
                $ret .= $tens[$num[1]];
            /** @noinspection PhpMissingBreakStatementInspection */
            case 1:
                $ret .= $ones[$num[0]];
            default:
                break;
        }

        return $ret;
    }
750897
public static function toRoman($num)
  {
    $num = (int)$num;
    switch($num){
      case 1:
        $roman = 'I';
        break;
      case 2:
        $roman = 'II';
        break;
      case 3:
        $roman = 'III';
        break;
      case 4:
        $roman = 'IV';
        break;
      case 5:
        $roman = 'V';
        break;
      case 6:
        $roman = 'VI';
        break;
      case 7:
        $roman = 'VII';
        break;
      case 8:
        $roman = 'VIII';
        break;
      case 9:
        $roman = 'IX';
        break;
      case 10:
        $roman = 'X';
        break;
      default:
        $roman = (string)$num;
        break;
    }
    
    return $roman;
  }
534998
protected function getNoun($num, $one, $two, $five)
    {
        return $this->helper->getNoun($num, $one, $two, $five);
    }
781727
protected function readIntegerList($num)
    {
        if ($this->littleEndian) {
            return unpack('V' . $num, fread($this->file, 4 * $num));
        }

        return unpack('N' . $num, fread($this->file, 4 * $num));
    }
743254
public static function word(int $num): string
    {
        $numberWordMap = [
            1 => Yii::t('yuncms', 'One'),
            2 => Yii::t('yuncms', 'Two'),
            3 => Yii::t('yuncms', 'Three'),
            4 => Yii::t('yuncms', 'Four'),
            5 => Yii::t('yuncms', 'Five'),
            6 => Yii::t('yuncms', 'Six'),
            7 => Yii::t('yuncms', 'Seven'),
            8 => Yii::t('yuncms', 'Eight'),
            9 => Yii::t('yuncms', 'Nine')
        ];

        if (isset($numberWordMap[$num])) {
            return $numberWordMap[$num];
        }

        return (string)$num;
    }
556834
public function seeResponseCodeIs($num)
    {
        \PHPUnit\Framework\Assert::assertEquals($num, $this->client->getInternalResponse()->getStatus());
    }
1103446
public function get($num)
    {
        if (isset($this->cache[$num])) {
            return $this->cache[$num];
        }

        return $this->cache[$num] = $this->execute($num);
    }
141055
public function getCall($num)
    {
        if (array_key_exists($num, $this->calls)) {

            return $this->calls[$num];
        }

        return null;
    }
1128922
public function getNumber(int $index): string
    {
        if ($index >= count($this->numbers)) {
            throw new \UndefinedOffsetException();
        }
        return $this->numbers[$index];
    }
308625
private function splitNumber($num)
    {
        if (is_string($num)) {
            $ret = array();

            $strlen = strlen($num);
            $first  = substr($num, 0, $strlen%3);

            preg_match_all('/\d{3}/', substr($num, $strlen%3, $strlen), $m);

            $ret =& $m[0];
            if ($first) {
                array_unshift($ret, $first);
            }
            return $ret;
        }

        return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers
    }
148779
protected function convert($num)
    {
        if ($num instanceof NumericTypeInterface) {
            return $num;
        }
        if (is_numeric($num)) {
            return $this->calcEngine->convertNumeric($num);
        }

        $type = (is_object($num) ? get_class($num) : gettype($num));
        throw new \BadMethodCallException('No solution for unknown type: ' . $type);
    }
939428
public function D2B($num)
    {
        $this->preOpMethodParamsCheck(array($num));

        /* Make sure that we're dealing with a decimal number. */
        $num = $this->decodeHex($num);

        try {

            $bin = '';

            while ($this->math->comp($num, '0') > 0) {
                switch ($this->math->mod($num, '2')) {
                    case '1':
                        $bin .= '1';
                        break;
                    default:
                        $bin .= '0';
                        break;
                }

                $num = $this->math->div($num, '2');
            }

            return $bin;

        } catch (\Exception $e) {
            throw $e;
        }
    }
49225
public static function Factorial($num) {
		if ($num < 0) throw new \InvalidArgumentException("Fatorial calls should be >0.");

		$rval=1;
		for ($i = 1; $i <= $num; $i++)
			$rval = $rval * $i;
		return $rval;
	}
1374661
public function field_name($num)
    {
        $info = $this->field_info_by_num($num);
        if (!$info) {
            return null;
        }
        
        return \SmartFactory\checkempty($info["name"]);
    }