math
[ class tree: math ] [ index: math ] [ all elements ]

Class: Math_Rpn

Source Location: /Math_RPN-1.1.2/Math/RPN.php

Class Overview




Methods


Inherited Variables

Inherited Methods


Class Details

[line 26]


[ Top ]


Method Detail

addOperator   [line 183]

void addOperator( string $operator, $function_name, [integer $priority = 3], [integer $no_of_arg = 0], [string $text = ''], string $function)

Add new operator
  • Access: public

Parameters:

string   $operator   —  New operator
string   $function   —  Function name
integer   $priority   —  New operator's priority
integer   $no_of_arg   —  Number of function's arguments
string   $text   —  New operator's description
   $function_name   — 

[ Top ]

calculate   [line 211]

mixed calculate( [mixed $input = ''], [string $angle = 'rad'], [boolean $is_rpn = true])

Calculate the $input expression
  • Return: Value of $input expression or a PEAR error
  • Access: public

Parameters:

mixed   $input   —  Infix expression string or RPN expression string
string   $angle   —  Angle's unit - 'rad' or 'deg'
boolean   $is_rpn   —  True if $input is RPN expression or false if $input is infix expression

[ Top ]

evaluate   [line 253]

mixed evaluate( [mixed $input = ''], [string $angle = 'rad'], [boolean $is_rpn = false])

Calculate the $input expression (alias of calculate())
  • Return: Value of $input expression or a PEAR error
  • Access: public

Parameters:

mixed   $input   —  Infix expression string or RPN expression array
string   $angle   —  Angle's unit - 'rad' or 'deg'
boolean   $is_rpn   —  True if $input is RPN expression or false if $input is infix expression

[ Top ]

getInputArray   [line 263]

array getInputArray( )

Return a input array
  • Return: Input array
  • Access: public

[ Top ]

getOperators   [line 143]

array getOperators( )

Return a operator's array
  • Return: Array with operator's name, priority, arguments, function's name and syntax
  • Access: public

[ Top ]

getRpnArray   [line 273]

array getRpnArray( )

Return a RPN array
  • Return: RPN array
  • Access: public

[ Top ]

getTimer   [line 283]

float getTimer( )

Return a counting time in second
  • Return: Counting time in seconds
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:32:31 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.