What's
New in version 2.91?
See Also: Upgrading Issues, uCalc
Language Builder
The improvements mentioned below are relevant mainly in the context
of moving from uCalc Fast Math Parser 2.0 to uCalc FMP 2.91. More advanced features that are also new can
be found in the uCalc Language Builder, which
is a superset of uCalc FMP, and available as a separate product. Differences between 2.9 and 2.91 are minor,
and mainly involve documentation improvements, cleaning up of include files,
and less confusing license options. The
free license in version 2.91 also lets you define more items them than in 2.9.
- The
IIF() function evaluates either the True argument or the False argument,
depending on the value of the Condition argument, but not both, unlike
version 2.0 which always evaluated both.
- You
can define callback functions similar to IIF() such that arguments passed
ByExpr (as opposed to ByRef or ByVal) are not evaluated ahead of
time. This was not possible in
version 2.0.
- It is
no longer necessary to set up definition space boundaries ahead of
time. Memory is gradually
allocated as needed. You won't
need ucReset (though you can release an entire thread using
ucReleaseItem), and you won't have to worry about running out of
definition space (assuming you don't intentionally, or inadvertently
devise a way to consume all your gigs of memory). And there is no maximum number of
arguments per function.
- FMP
2.0 only allowed you to define infix (binary) operators. Now you can also define prefix
and postfix operators as well.
See DemoDefs.Txt for examples.
- FMP
2.0 operator definitions didn't allow you to set individual precedence
levels for each operator, as you can do now. See DemoDefs.Txt for examples.
- Case
sensitivity can be turned on or off.
(It's off by default).
- User-friendly
form-based demos for PowerBASIC, Borland C++ Builder, VC++, and VB.NET are
now included. (VB classic, and
Delphi already had form-based demos).
- Support
for VB.NET was added.
- Speed.
The new uCalc should be much faster, both in terms of parsing speed, and
in evaluation speed. The
difference in speed may range from barely noticeable to very dramatic,
depending on what you are doing, how you choose to implement things, and
in some cases which compiler you are using. By default, compilers that have native support for 80-bit
precision can benefit the most in numeric calculations. Compilers that support pointers can
create callbacks that use uCalc's NativeCall (an advanced Language Builder feature) for more
efficiency.
- You
can attach a uCalc variable to the address of a variable defined in your
source code. See the source code
for the Plotting and Sum examples in the demo files (excluding VB.NET).
- Specific
data types (Single, Double, Long, String, WideString, LPCSTR, etc...) are
supported, replacing generic numeric and string types.
- There
is no longer a problem with using ucEval or ucEvalStr in your callbacks.
- Function
overloading is supported.
- Function
bootstrapping is supported.
- Function
recursion is supported.
- More
function definition flexibility is supported.
- Multi-threading
is supported.
- Multi-statement
expressions are supported.
- Overall
syntax was simplified.
- The
FPU word of the host program and uCalc's FPU word are insulated from each
other.
- FPU
errors such as Overflow, Underflow, Division-by-0, etc... can be caught,
or masked.
- uCalc()
is a function that encapsulates all of uCalc's functionality. This function can be made available
even to the end-user.