Math::RPN 1.08
Sponsored Links
Math::RPN 1.08 Ranking & Summary
File size:
0.008 MB
Platform:
Any Platform
License:
Freeware
Price:
Free
Downloads:
10
Date added:
2007-06-28
Publisher:
Owen DeLong
Publisher URL:
http://search.cpan.org/~o
Math::RPN 1.08 description
RPN is a Perl extension for Reverse Polish Math Expression Evaluation.
SYNOPSIS
use Math::RPN;
$value=rpn(expr...);
@array=rpn(expr...);
expr... is one or more scalars or lists of scalars which contain
RPN expressions. An RPN expression is a series of numbers and/or
operators separated by commas. (commas are only required within
scalars).
The rpn function will take a scalar or list of sclars which contain an RPN expression as a set of comma delimited values and operators, and return the result or stack, depending on context. If the function is called in an array context, it will return the entire remaining stack. If it is called in a scalar context, it will return the top item of the stack. In a scalar context, if more than one value remains on the stack, a warning will be sent to STDERR.
In the event of an error, an error message will be sent to STDERR, and rpn will return undef.
The expression can contain any combination of values and operators. Any token which is not an operator is assumed to be a value to be pushed onto the stack.
An explanation of Reverse Polish Notation is beyond the scope of this document, but it I will describe it briefly as a stack-based way of writing mathematical expressions. This has the advantage of eliminating the need for parenthesis and simplifying parsing for computers vs. normal algebraic notation at a slight cost in the ability of humans to easily comprehend the expressions.
This evaluator works by cycling through the expression from left to right. As each token is encountered, it is checked against the list of operators. If it matches, then a check is performed for stack underflow.
If the stack has not underflowed, the operation is performed by removing the required number of operands from the top of the stack. The result is then pushed on to the stack. Operations for which order is significant (-,/,%,etc.) are processed such that the top item on the stack is treated as the right operand, and the next item down is treated as the left operand. Thus, "5,3,-" would yield 2, not -2. If the token does not match any of the known operators, the token is blindly pushed onto the stack. As a result, one can produce unexpected results. For example, the expression "5,3,grandma,+,*" would produce 15 because 5*(3+0) is how it would end up evaluated. That is, 5 would be pushed onto the stack, then 3, then "grandma". Next, + is evaluated, so 3+"grandma" is evaluated. PERL evaluates "grandma" to be numerically 0, so 3 is pushed back onto the stack. Next, the * multiplies the top two items of the stack [5][3], producing 15, which is pushed back onto the stack.
SYNOPSIS
use Math::RPN;
$value=rpn(expr...);
@array=rpn(expr...);
expr... is one or more scalars or lists of scalars which contain
RPN expressions. An RPN expression is a series of numbers and/or
operators separated by commas. (commas are only required within
scalars).
The rpn function will take a scalar or list of sclars which contain an RPN expression as a set of comma delimited values and operators, and return the result or stack, depending on context. If the function is called in an array context, it will return the entire remaining stack. If it is called in a scalar context, it will return the top item of the stack. In a scalar context, if more than one value remains on the stack, a warning will be sent to STDERR.
In the event of an error, an error message will be sent to STDERR, and rpn will return undef.
The expression can contain any combination of values and operators. Any token which is not an operator is assumed to be a value to be pushed onto the stack.
An explanation of Reverse Polish Notation is beyond the scope of this document, but it I will describe it briefly as a stack-based way of writing mathematical expressions. This has the advantage of eliminating the need for parenthesis and simplifying parsing for computers vs. normal algebraic notation at a slight cost in the ability of humans to easily comprehend the expressions.
This evaluator works by cycling through the expression from left to right. As each token is encountered, it is checked against the list of operators. If it matches, then a check is performed for stack underflow.
If the stack has not underflowed, the operation is performed by removing the required number of operands from the top of the stack. The result is then pushed on to the stack. Operations for which order is significant (-,/,%,etc.) are processed such that the top item on the stack is treated as the right operand, and the next item down is treated as the left operand. Thus, "5,3,-" would yield 2, not -2. If the token does not match any of the known operators, the token is blindly pushed onto the stack. As a result, one can produce unexpected results. For example, the expression "5,3,grandma,+,*" would produce 15 because 5*(3+0) is how it would end up evaluated. That is, 5 would be pushed onto the stack, then 3, then "grandma". Next, + is evaluated, so 3+"grandma" is evaluated. PERL evaluates "grandma" to be numerically 0, so 3 is pushed back onto the stack. Next, the * multiplies the top two items of the stack [5][3], producing 15, which is pushed back onto the stack.
Math::RPN 1.08 Screenshot
Sponsored Links
Math::RPN 1.08 Keywords
Bookmark Math::RPN 1.08
Math::RPN 1.08 Copyright
WareSeeker periodically updates pricing and software information of Math::RPN 1.08 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Math::RPN 1.08 Edition. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Math::RPN 1.08 Related Software

Tux, of Math Command project is a math practice game for elementary school level children.

Math::CDF is a Perl module to generate probabilities and quantiles from several statistical probability functions.

Math::NumberCruncher Perl module contains a collection of useful math-related functions.

Math::MatrixReal::Aug Perl module contains additional methods for Math::MatrixReal.

Math Objects is a math template library for C++ using generic programming techniques.

Math::ODE Perl module allows you to solve N-th Order Ordinary Differential Equations with as little pain as possible.
My Software
You have not saved any software. Click "Save" next to each software to save it to your software basket
Related Search
TOP POPULAR DOWNLOAD
