uCalc Fast Math Parser - Summary

by uCalc Software - Product Type: Component / .NET Class / DLL

Summary

uCalc Fast Math Parser by uCalc Software

A math parser for programmers. uCalc FMP is a 32-bit DLL component which allows your program to evaluate expressions that are defined at runtime. uCalc FMP is a fast, reliable and flexible math engine that allows you to develop applications that allow end users to add their own set of formulas whenever they want instead of having to pre-determine them. It includes direct support for .NET compilers, Visual Basic, Visual Basic .NET, and Visual C++, Borland C++ Builder, Delphi and PowerBASIC (PB/DLL and PB/CC).

uCalc FMP allows programs to evaluate math expressions that are defined at run time. It parses them, evaluates formulas and performs the calculations with extended precision via 80-bit numbers. uCalc Fast Math Parser performs everything from basic arithmetic to advanced trigonometric calculations. Ease of implementation, flexibility, sturdiness and speed are at the core of the product's design. It includes direct support for Borland C++ Builder, Delphi, PowerBASIC (PB/DLL and PB/CC), Visual Basic (classic), Visual Basic .NET, and Visual C++.

uCalc FMP in a nutshell

Example 1: This lets the end-user evaluate an expression such as 6+4*5/2

UserExpr$ = InputBox$("Enter an expression",,"6+4*5/2")

Print ucEval(UserExpr$) ' Returns 16

Example 2: This user expression is very rapidly evaluated in a loop

(See the demo that comes with the download for a more complete example)

UserExpr$ = InputBox$("Enter an expression",,"x^2+x+1")

xPtr = ucDefineVariable("x As Double", VarPtr(x))

ExprPtr = ucParse(UserExpr$)

For x = 1 To 1000000

SumTotal = SumTotal + ucEvaluate(ExprPtr)

Next

uCalc FMP is used by some Fortune 500 companies from categories such as Aeronautics, Automobile, Banking, Computers, and Securities.

Operators and functions available to end-users

The first section lists functions and operators that are typically familiar, each with a quick description and example. The subsequent section lists special functions that require additional explanations.

SymbolDescriptionExample

!Factorial5! = 120

^Raised to the power of4 ^ 5 = 1024

*Multiply by3 * 6 = 18

/Divide by9 / 2 = 4.5

\Integer divide by9 \ 2 = 4

modModulo (remainder)7 mod 4 = 3

+Add1 + 1 = 2

-Subtract9 - 5 = 4

-Unary negation-(5+4) = -9

+Concatenate'Zeb' + 'ra' = 'Zebra'

>Greater than (numeric)9 > 2 = 1

<Less than (numeric)7 < 4 = 0

==Equal test (numeric)5 == 4 = 0

>=Greater or equal (numeric)3 >= 3 = 1

<=Less or equal (numeric)#h3E <= 9 = 0

<>Not equal (numeric)#b10101 <> 20 = 1

>Greater than (string)'This' > 'That' = 1

<Less than (string)'This' < 'That' = 0

==Equal test (string)'A' == 'B' = 0

>=Greater or equal (string)'Zeb' >= 'Zebra' = 0

<=Less or equal (string)'Zeb' <= 'Zebra' = 1

<>Not equal (string)'X' <> 'Y' = 1

AndBitwise AND#b101 AND #h1E = 4

OrBitwise OR13 OR 6 = 15

AndAlsoShort-circuit And

OrElseShort-circuit Or

IIFIf condition (numeric)IIf(1+1=2, 4, 5) = 4

IIFIf condition (string)IIf(1, 'T', 'F') = 'T'

MinMinimum valuemin(10, 3) = 3

MaxMaximum valuemax(1, 9, 2) = 9

SinSinesin(pi) = 0

CosCosinecos(pi) = -1

TanTangenttan(pi) = 0

AtanArc tangentatan(0) = 0

AbsAbsolute valueabs(-8) = 8

Expe to the power ofexp(3) = 20.08

LogNatural loglog(16) = 2.77

CeilRound upceil(6.2) = 7

IntTruncate to an integerint(6.8) = 6

FracFractional partFrac(3.125) = 0.125

SgnSign (returns -1, 0, or 1)sgn(-9) = -1

SqrSquare rootsqr(64) = 8

Functions that require further explanation:

Asc(StringArg [, Position])

Returns the ASCII value of a character. If the Position argument is omitted, then the ASCII value of the first character of the string is returned, otherwise the value of the nth position (starting with 1), as supplied by the Position argument is returned.

BaseConvert(Number, FromBase)

Converts from a given base to base 10. Number is a string argument (to allow for non-numeric digits as used in hexadecimal), and FromBase is numeric.

Example: BaseConvert("101", 2) returns 5

Chr(Number)

Returns the character associated with the ASCII value supplied as the Number argument.

Min(a, b [, ...])

Max(a, b [, ...])

These two are actually mocro-like items instead of functions. They take any number of arguments and return the minimum argument (for Min), or the maximum argument (for Max). They work with both string and numeric arguments. Arguments must be either all strings or all numbers

Precedence(Operator)

Returns the precedence level of a given operator. The Operator argument is a string.

Rand([x])

Rand(a, b)

Options

No parameters

Returns a floating point random number between 0 and 1. The number chosen is the next in a random sequence.

x > 0

Returns a floating point random number between 0 and 1. The number chosen is the next in a random sequence.

x = 0

Returns the same random number as the one previously generated.

x < 0

Returns the same random number each time, using the parameter as seed.

a, b

Returns an integer random number between a and b.

SetSyntaxParams(Params, Expression [, Thread])

This adds curly braces { and } around parameters in a string so that this string can be used as a syntax definition. This allows for the definition of macros, for instance.

Params is a string argument, which contains a list of parameters. The parameters in the string do not have to be organized in any special way. uCalc will pick out all alphanumeric elements in the string and treat those as the parameters. Expression is a string containing a definition that is to be parameterized. That is, curly braces will be added around each alphanumeric occurrence in Expression that was found in Params. Parameter names are not case sensitive. The thread argument is optional. A value of 0 represents the current thread.

The example below shows how you might call SetSyntaxParams. Here uCalc picks out x, y, and z from Params as parameters. Occurrences of x, y, and z in the second argument are surrounded by curly braces in the transformed string:

Expression ==> SetSyntaxParams("(x, y, z)", "macro(x, y, z) = sin(x)*y+abc+x-z")

Transformation ==> macro({x}, {y}, {z}) = sin({x})*{y}+abc+{x}-{z}

Here, the first argument could have equally been "x, y, z"; "(x y z)", "[x+y+z]", "((x) (y) (z))", etc...

See also the Macro construct at the very end of the include file.

uc_For(Counter, Step, Start, Finish, Expression)

This repeats the evaluation of Expression a certain number of times, as in a For/Next loop. The Counter argument accepts a numeric variable, which will first be set to the value of Start, and then successively be incremented by the amount of Step, until the Counter variable is finally set equal to Finish, at which point the loop ends. The return value is the result of the evaluation of the expression in its last iteration.

uc_Loop(DoCondition, Expression, LoopCondition)

This repeats the evaluation of the Expression argument until either DoCondition or LoopCondition is equal to 0. The value of DoCondition is checked prior to the evaluation of the expression, while the value of LoopCondition is checked after the expression is evaluated. The return value is the result of the evaluation of the expression in its last iteration.

uCalc(Command [, ...])

uCalcStr(Command [, ...])

uCalc and uCalcStr correspond with the uCalc function. This allows you to expose all of uCalc's functionality to the end-user. The end-user can use uCalc or uCalcStr in an expression just like any other function listed in this help file topic. This function is reserved for the commercial uCalc FMP license, or the uCalc Language Builder.

New or Enhanced

The IIF function now only evaluates either the True argument, or the False one, but not both.

The IIF function can work with either numeric or string arguments.

String relational (comparison) operators were added.

There is no longer any ambiguity between the + operator, the & operator, and the AND operator, for strings and numbers.

Standard license includes

A license key that removes the message box

Full feature set of uCalc Fast Math Parser

Priority technical support

Free upgrade(s) up to (and including) version 3.0 of uCalc Fast Math Parser

Free license for uCalc Language Builder when that becomes available (a $950 value)

Free serial number for previous versions (upon request)

Lite license

The lite license is for those who want a fast math parser, but don't care for advanced features. You can always upgrade later if necessary.

You get a license code that removes the message box, but with limitations.

The following end-user functions (that is functions that can be used in an expression) are disabled when the lite license option is applied:

uCalc and uCalcStr (uCalc and uCalcStr are still available at the compiler level),

uc_For, uc_Loop

SetSyntaxParams (Macro uses SetSyntaxParams, therefore that is disabled as well)

Usage of the Table and Stack types is restricted

ucExpand, ucGetItemData, and ucSetItemData are unavailable

You are limited to 55 syntax definitions (with ucDefineSyntax)

NOTE: Syntax definitions found in the include file count towards the definition limit, and deplete much of the limit. You can delete some definitions in the include file in order to make room for definitions of your own if necessary. And some definitions may internally count as multiple definitions.

Top 10 Reasons why uCalc customers said they have chosen to buy the uCalc Standard Edition:

1. Speed. When it comes to working with multiple equations at a time, customers have mentioned that uCalc is much faster than other parsers.

2. Customers mentioned flexibility as an advantage over other parsers.

3. Customers also found uCalc FMP very easy to implement in a program.

4. Customers find it easy to add new functions, operators and variables.

5. Customers have chosen uCalc for reliability / stability / quality as they have had bad experiences with other parsers they have tried before.

6. uCalc goes beyond just math/maths expressions, as it can handle strings as well.

7. The new ability to change syntax is considered useful by some customers.

8. Customers found that the multi-threading capability was useful.

9. uCalc is good at catching exceptions and error handling.

10. Customers thought that the uCalc product technical support was beyond what they had experienced with other products.

PartNumbers: PC-509908-153973 509908-153973 PC-509908-140576 509908-140576 PC-509908-140577 509908-140577 PC-509908-140578 509908-140578 PC-509908-140579 509908-140579 PC-509908-140584 509908-140584

PurchaseOptions: uCalc Fast Math Parser Lite Edition V2.95 1 Developer License , uCalc Fast Math Parser Standard Edition V2.95 1 Developer License , uCalc Fast Math Parser Standard Edition V2.95 1 Developer License, price per license from 2 to 9 licenses , uCalc Fast Math Parser Standard Edition V2.95 1 Developer License, price per license from 10 licenses , uCalc Fast Math Parser Standard Edition V2.95 1 Developer Upgrade License from uCalc Fast Math Parser V2.0 , uCalc Fast Math Parser Standard Edition V2.95 1 Developer Upgrade License from Lite Edition

Resources: Read the uCalc Fast Math Parser help file, Download the uCalc Fast Math Parser V2.95 evaluation on to your computer - Displays Nag Screens

Operating System for Deployment: Windows Vista, Windows XP, Windows 2000, Windows 98, Windows NT 4.0

Architecture of Product: 32Bit

Product Type: Component

Component Type: .NET Class, DLL

Compatible Containers: Microsoft Visual Studio 2005, Microsoft Visual Studio .NET 2003, Microsoft Visual Studio .NET, Microsoft Visual Studio 6.0, Microsoft Visual Basic 2005, Microsoft Visual Basic .NET 2003, Microsoft Visual Basic .NET, Microsoft Visual Basic 6.0, Microsoft Visual C++ 2005, Microsoft Visual C++ .NET 2003, Microsoft Visual C++ .NET, Microsoft Visual C++ 6.0, Microsoft Visual C++ 5.0, Microsoft Visual C# 2005, CodeGear C++ 5.0 (formerly Borland), CodeGear C++ (formerly Borland), C++Builder 5, C++Builder 4, Delphi 5.0, Delphi 4.0

Keywords: UCALC uCalc Software Math Stats Mathematics Mathematical Statistic Statistical Author uCalcFMP uCalc FMP Standard fast math maths parse parser parsing equation resolve resolver resolution

Product Search

Enter search words:

Quick Links

Publisher

Primary Category