Data Types

 

The following data types are included by default in the uCalc library, and are for the most part declared in Types.uc if you are using the uCalc Interactive Interpreter, or a uCalc header/include file for your compiler if you are using uCalc Fast Math Parser:

 

Single

Single precision floating point

Double

Double precision floating point

Extended

Extended precision (80-bit long double) floating point

Byte

8-bit unsigned integer

Word

16-bit unsigned integer

Dword

32-bit unsigned integer

Integer

16-bit signed integer

Long

32-bit signed integer

Int64

64-bit signed integer

Currency

64-bit currency type

String

Dynamic multi-byte string with 1 byte/character

WideString

Dynamic Unicode string with 2-bytes/character

LPCSTR

Null-terminated string

FixedString

Fixed-length string

Stack

Multi-purpose stack list type

Table

Table

SortedList

Sorted list

Void

For routines where the return type is not needed

 

 

Default data type

 

uCalc Fast Math Parser starts with the default type of Double for the following compilers:  VB Classic, VB.NET (and other .NET compilers), and VC++.  The starting default type is Extended for these compilers:  PowerBASIC, Delphi, and BC++B.  The uCalcWrp.dll file also uses Extended as the default type.

 

You may change the default data type using one of the following methods:

 

ucDefine "DefaultType: TypeName"

   or

uCalc(uc_SetDefaultType, 0, TypeHandle)

 

where TypeName is the name of a data type, from the list of types listed above, and TypeHandle is a numeric value representing the handle of a data type.  Some named type handles, such as ucLong, ucDouble, ucExtended, etc., are defined in the include file.

 

Whenever a data type is not explicitly stated in a definition (such as for functions and variables), the default type will be implied.

 

It is best to use the default numeric and string types that were set in the include file for your compiler, unless you have defined native routines using other data types.  Otherwise internal conversions may take place, which can slow down operations.