Returns the numeric value of a function node.

@param FunctionNode $functionNode
@return int|float
513080
protected function calculateFunctionNode(FunctionNode $functionNode)
    {
        $nodes = $functionNode->getChildNodes();

        $arguments = [];
        $argumentChildNodes = [];

        foreach ($nodes as $node) {
            if (is_a($node, SymbolNode::class)) {
                /** @var SymbolNode $node */

                if (is_a($node->getSymbol(), AbstractSeparator::class)) {
                    $containerNode = new ContainerNode($argumentChildNodes);
                    $arguments[] = $this->calculateContainerNode($containerNode);
                    $argumentChildNodes = [];
                } else {
                    $argumentChildNodes[] = $node;
                }
            } else {
                $argumentChildNodes[] = $node;
            }
        }

        if (sizeof($argumentChildNodes) > 0) {
            $containerNode = new ContainerNode($argumentChildNodes);
            $arguments[] = $this->calculateContainerNode($containerNode);
        }

        /** @var AbstractFunction $symbol */
        $symbol = $functionNode->getSymbolNode()->getSymbol();

        $result = $symbol->execute($arguments);

        return $result;
    }
1176137
public function getDesde()
    {
        if (!$this->xml) {
            return false;
        }
        $D = $this->xml->getElementsByTagName('D')->item(0);
        return $D ? (int)$D->nodeValue : false;
    }
1074890
public function getNode( $node )
	{
		for( $i=0; $i<$this->count(); $i++ )
			if( $this->nodes[$i]->getNodeName() == $node )
				return $this->nodes[$i];
		return NULL;
	}
590091
def number(v):
    """"""
    if nodesetp(v):
        v = string(v)
    try:
        return float(v)
    except ValueError:
        return float('NaN')
954585
public function getRootNode(\DOMDocument $dom)
    {
        $rootNodes = $dom->getElementsByTagNameNS(self::NAMESPACE_URI, 'RDF');
        if ($rootNodes->length != 1) {
            Throw new InvalidNumberOfRootTagsException('RDF', $rootNodes->length);
        }
        return $rootNodes->item(0);
    }
785472
public function castFloat()
    {
        $castFunction = function ($value) {
            return (float) $value;
        };

        if (is_numeric($this->value)) {
            return $castFunction($this->value);
        }

        return $this->handleMismatch($castFunction, 'double');
    }
145892
def _eval_num(self, node):
        
        if self.floats:
            return node.n
        else:
            return int(node.n)
530439
public function indexOf(callable $callback) {
    foreach ($this->nodes as $i => $node) {
      if ($callback($node)) {
        return $i;
      }
    }
    return -1;
  }
675158
Node createSuperForFunction(Node functionNode) {
    final Node result = IR.superNode();
    if (isAddingTypes()) {
      result.setJSType(getTypeOfSuperForFunctionNode(functionNode));
    }
    return result;
  }
761757
private function visitFactorialNode(FunctionNode $node)
    {
        $functionName = $node->getName();
        $op = $node->getOperand();
        $operand = $op->accept($this);

        // Add parentheses most of the time.
        if ($this->isNumeric($op)) {
            if ($op->getValue() < 0) {
                $operand = "($operand)";
            }
        } elseif ($op instanceof VariableNode || $op instanceof ConstantNode) {
            // Do nothing
        } else {
            $operand = "($operand)";
        }

        return "$operand$functionName";
    }
349370
public FunctionNode getEnclosingFunction() {
        AstNode parent = this.getParent();
        while (parent != null && !(parent instanceof FunctionNode)) {
            parent = parent.getParent();
        }
        return (FunctionNode)parent;
    }
1305673
public function getNodeByValue($value): ?Node {
        /**
         * @var string $arrayIndex
         * @var SinglyLinkedList $list
         */
        foreach ($this->bucket as $arrayIndex => $list) {
            /*
             * $list is the first element in the bucket. The bucket
             * can contain max $maxSize entries and each entry has zero
             * or one nodes which can have zero, one or multiple
             * successors.
             *
             */
            if (!$list->containsValue($value)) {
                continue;
            }
            $node = $list->getNodeByValue($value);
            return $node;
        }
        //return null if there is no value
        return null;
    }
1202835
function getInteger(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'value', [
        'options' => [],
        'textOptions' => []
      ]);

      return HtmlHelper::encode(\Yii::$app->formatter->asInteger(
        $args['value'],
        $args['options'],
        $args['textOptions']
      ));
    };
  }
353711
protected function _functionNode()
    {
        $node = new FunctionDef();
        $token = $this->_stream->current(true);
        $parent = $this->_states['current'];

        $body = $token[1];
        $name = substr($this->_stream->next('('), 0, -1);
        $body .= $name;
        $node->name = trim($name);
        $args = $this->_parseArgs();
        $node->args = $args['args'];
        $body .= $args['body'] . $this->_stream->next([';', '{']);
        if ($parent) {
            $isMethod = $parent->hasMethods;
            if ($parent->type === 'interface') {
                $node->type = 'signature';
            }
        } else {
            $isMethod = false;
        }
        $node->isMethod = $isMethod;
        $node->isClosure = !$node->name;
        if ($isMethod) {
            $node->visibility = $this->_states['visibility'];
            $this->_states['visibility'] = [];
        }
        $node->body = $body;
        $this->_codeNode();
        $this->_states['body'] = $body;
        $this->_contextualize($node);

        // Looking for curly brackets only if not an "abstract function"
        if ($this->_stream->current() === '{') {
            $this->_states['current'] = $node;
        }

        return $node->function = $node;
    }
784646
public static function getCacheTime( $functionName )
    {
        static $mtime = null;
        if ( $mtime === null )
        {
            $mtime = filemtime( __FILE__ );
        }
        return $mtime;
    }
412838
protected function getFieldValue(
        Crawler $node,
        $defaultValue,
        $callback = null,
        $funcName = 'text',
        $funcParam = ''
    ) {
        if ($callback == null) {
            $callback = function ($value) {
                return (new DefaultSanitizer)->clean($value);
            };
        }

        if ($node->count()) {
            return $callback($node->$funcName($funcParam));
        }

        return $defaultValue;
    }
596352
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if (!($other instanceof FunctionNode)) {
            return false;
        }

        $thisOperand = $this->getOperand();
        $otherOperand = $other->getOperand();

        return $this->getName() == $other->getName() && $thisOperand->compareTo($otherOperand);
    }