See Also:† Upgrading Issues, uCalc Language Builder
New or enhanced in
Incorrectly exported string routines were fixed.
Some missing demo programs were added.
ucSetOutput() was missing.† Now itís available.
New or enhanced in
A function can be redefined in such a way that
other functions that call it will be affected by the updated definition as well
(useful for dependent spreadsheet cells for instance).
The output format for numbers can be configured.
Operators can be defined with right to left
The speed for Min() and
Max() was drastically improved.† They are
now defined as functions instead of recursive syntax macros.
When a definition fails (such as for syntax
errors), the error handler is invoked (assuming youíve defined one).† In the previous version, definition errors
were aborted silently.
There is a very large number of parsing
improvements that are beyond the scope of the math parser.
Thread handling with ucThread() has improved.
FIX: Implicit multiplication has the same
precedence level as explicit multiplication.
FIX: Better parsing; better at resolving
potentially ambiguous expressions.
FIX: Invalid expressions are less likely to
cause the program to crash.
New or enhanced in version 2.96
documentation.† The help file
includes examples for the various supported compilers, and more
comprehensive explanations.† The
source code in the demo is interspersed with comments.† The Spreadsheet and Equation Solver
examples are included in the main zip file, instead of as separate
simpler method for native callbacks.
- Local variable construct (this is used in the
Equation Solver, and Summation examples).
can also use ucDefine.
- Speed.† Version 2.96 is faster than any previous
version.† In some cases the
difference is dramatic.
Log, and Sqr were improved.† If the left operand of ^ is a negative
number, and the right operand is a non-integer, or the argument of Log or Sqr is negative, then it raises an exception (or
returns NaN), instead of returning an incorrect
value.† Also, an infix operator,
such as ^, no longer causes a problem if followed by a unary operator (for
instance 3 ^ - 2).
last argument of IIF is optional.
2.96 is better at catching errors and exceptions overall.
which was present in 2.0 was restored.†
It allows you to choose between radian, grad, or degree mode for
is a new function that lets your callback know what thread the current
callback is being called from.
lets your callback raise an error (based on the given error number
ucRaiseErrorMessage allows your callback to
raise an error with a customized error message.
lets your error handler re-raise an exception, allowing your host program
to catch it with try / except (or the equivalent error handler for
returns the location of an error in an expression.
(formerly ucGetSymbol) returns the name of the
offending symbol when an error occurs during parsing.
The Error function lets you raise an
error from within your expression.
SetVar, which was
already in the DLL, is now declared in the header / include file, and
explained in the help file.† It lets
your expression set the value of a variable.
sets the value of a variable using the variable's handle.† This is a replacement for the ucSetValueDbl routine that was available for some
Arrays are supported.
DLLs now contain version information (before, only the main DLL did).
Unicode for VC++.
features beyond the scope of this help file (and which are subject to
^ operator, and the Log and Sqr functions are
ucParamStr, ucParamCount, ucReturn and ucReturnStr were optimized
for use with native callbacks.†
Pointers are no longer necessary for achieving a faster speed than
involving an automatic conversion between Long
and Double are much faster.
- PowerBASIC users in particular will notice that ucEvaluate()
runs faster for them.
list of bug fixes:
- ~Eval (which evaluates a sub-expression in place
during pre-parsing) now has sister routines ~Eval_1, which substitutes
the result of the evaluation, and moves on without passing over it a
second time, and ~Eval_P, which evaluates
during the parsing stage.† Likewise
~Expand has a ~Expand_1 counterpart.
evaluation (for faster speed).
routines: ucHandle(), ucRename()
numeric pattern in the header / include file was fixed so that variable
names that start with an "e" and a number, such as
e123_somename, no longer cause a problem.
leading 0 in a fractional number between 0 and 1 is optional again, as it
was in 2.0.† For instance .5 is
accepted (as the equivalent of 0.5).
errors in ucDefine (and related routines, such
as ucDefineVariable, ucDefineFunction,
etc.) will no longer cause a crash.
- ByExpr no longer has to be the last argument when
present in a function definition.
- ByExpr now works with operators definitions as well.
a something such as "f(x=-1) = ..." didn't work if there was no
space between the = sign and -. Fixed.
exceptions are handled more consistently.
and OrElse were fixed.
New or enhanced in version 2.95
- Speed.† Versions 2.9 and 2.91 were slower than
2.0 in some ways, so the product was temporarily renamed uCalc Free Math Parser and then uCalc
FMP.† Version 2.95 is now faster
than ever, so the original uCalc Fast Math
Parser product name was reclaimed.†
Optimizations were implemented for user-defined functions (and
operators), and for compilers that support Double precision so that
extraneous conversions to Extended precision are no longer performed.† The speed bump in updating variable
values under VB.NET was also diminished.
direct .NET support.† A special .NET
DLL is included, which should work with any .NET compiler, and not just
error handling; particularly for errors that occur elsewhere other than
the default thread, as well as when defining an item.
leak for ucStrReturn, which affected some
compilers, is fixed.
New or enhanced in version 2.91: (minor upgrade)
was revised, licensing options were made less confusing, and include files
were cleaned up.
New or enhanced in version 2.9:
The improvements mentioned below are relevant mainly in the
context of moving from uCalc Fast Math Parser 2.0 to
version 2.9.† More advanced features that
are also new can be found in the uCalc Language Builder, which is a superset of uCalc FMP, and available separately.
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.
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.
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.
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.
sensitivity can be turned on or off.†
(It's off by default).
form-based demos for PowerBASIC, Borland C++
Builder, VC++, and VB.NET are now included.† (VB classic,
and Delphi already had form-based demos).
for VB.NET was added.
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
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).
data types (Single, Double, Long, String, WideString,
LPCSTR, etc.) are supported, replacing generic numeric and string types.
is no longer a problem with using ucEval or ucEvalStr in your callbacks.
overloading is supported.
bootstrapping is supported.
recursion is supported.
function definition flexibility is supported.
expressions are supported.
syntax was simplified.
FPU word of the host program and uCalc's FPU
word are insulated from each other.
errors such as Overflow, Underflow, Division-by-0, etc., can be caught, or
is a function that encapsulates all of uCalc's
functionality.† This function can be
made available even to the end-user.