uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Product:
Class:
Determines if the data type represents a compound value, such as a String or Complex number.
The IsCompound property helps distinguish between simple, fundamental data types and more complex, composite ones.
A compound data type is one that is not a simple, primitive numeric or boolean value. In uCalc, this currently includes String and Complex types. This is useful for logic that needs to handle strings and numbers differently without checking for every possible numeric type individually.
true for Compound TypesString: A sequence of characters.Complex: A number consisting of a real and an imaginary part.false for Simple TypesBooleanByte (Int8)Int16, Int32, Int64Single, DoubleWithout uCalc, determining if a type is "compound" in a host language like C# can be ambiguous. A developer might check if a Type object IsPrimitive or IsValueType, but these concepts don't map directly to uCalc's domain. For example, a C# string is a class (a reference type), not a primitive, while a System.Numerics.Complex is a struct (a value type).
uCalc's IsCompound provides a consistent and straightforward way to classify types based on their role within the expression engine, simplifying the logic for the end-user.
For example, to categorize results:csharp
var dt = uc.DataTypeOf(expression);
if (dt.IsCompound()) {
// Handle string or complex result
} else {
// Handle numeric or boolean result
}
ID: 87
using uCalcSoftware;
var uc = new uCalc();
Console.WriteLine(uc.DataTypeOf("2 * (3 + 4)").IsCompound);
Console.WriteLine(uc.DataTypeOf(" 'Hello ' + 'world!' ").IsCompound);
Console.WriteLine(uc.DataTypeOf("3 + 4 * #i").IsCompound);
Console.WriteLine(uc.DataTypeOf(BuiltInType.String).IsCompound);
Console.WriteLine(uc.DataTypeOf("Bool").IsCompound);
False
True
True
True
False using uCalcSoftware; var uc = new uCalc(); Console.WriteLine(uc.DataTypeOf("2 * (3 + 4)").IsCompound); Console.WriteLine(uc.DataTypeOf(" 'Hello ' + 'world!' ").IsCompound); Console.WriteLine(uc.DataTypeOf("3 + 4 * #i").IsCompound); Console.WriteLine(uc.DataTypeOf(BuiltInType.String).IsCompound); Console.WriteLine(uc.DataTypeOf("Bool").IsCompound);
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
#define tf(IsTrue) ((IsTrue) ? "True" : "False")
int main() {
uCalc uc;
cout << tf(uc.DataTypeOf("2 * (3 + 4)").IsCompound()) << endl;
cout << tf(uc.DataTypeOf(" 'Hello ' + 'world!' ").IsCompound()) << endl;
cout << tf(uc.DataTypeOf("3 + 4 * #i").IsCompound()) << endl;
cout << tf(uc.DataTypeOf(BuiltInType::String).IsCompound()) << endl;
cout << tf(uc.DataTypeOf("Bool").IsCompound()) << endl;
}
False
True
True
True
False #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; cout << tf(uc.DataTypeOf("2 * (3 + 4)").IsCompound()) << endl; cout << tf(uc.DataTypeOf(" 'Hello ' + 'world!' ").IsCompound()) << endl; cout << tf(uc.DataTypeOf("3 + 4 * #i").IsCompound()) << endl; cout << tf(uc.DataTypeOf(BuiltInType::String).IsCompound()) << endl; cout << tf(uc.DataTypeOf("Bool").IsCompound()) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Console.WriteLine(uc.DataTypeOf("2 * (3 + 4)").IsCompound)
Console.WriteLine(uc.DataTypeOf(" 'Hello ' + 'world!' ").IsCompound)
Console.WriteLine(uc.DataTypeOf("3 + 4 * #i").IsCompound)
Console.WriteLine(uc.DataTypeOf(BuiltInType.String).IsCompound)
Console.WriteLine(uc.DataTypeOf("Bool").IsCompound)
End Sub
End Module
False
True
True
True
False Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Console.WriteLine(uc.DataTypeOf("2 * (3 + 4)").IsCompound) Console.WriteLine(uc.DataTypeOf(" 'Hello ' + 'world!' ").IsCompound) Console.WriteLine(uc.DataTypeOf("3 + 4 * #i").IsCompound) Console.WriteLine(uc.DataTypeOf(BuiltInType.String).IsCompound) Console.WriteLine(uc.DataTypeOf("Bool").IsCompound) End Sub End Module