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:
Sets the double-precision floating-point return value for a custom function or operator implemented via callback.
This method does not return a value.
The Return method (or synonymous ReturnDbl) is the primary mechanism for sending a double result from a native callback function back to the uCalc evaluation engine. When a custom function or operator is called within an expression, this method must be used to provide its output.
This method is specifically for returning double values. uCalc provides a family of type-safe return methods for other data types. Using the correct method ensures data integrity and avoids unnecessary type conversions.
Return / ReturnDbl: For double values (this method).ReturnStr: For string values.ReturnBool: For boolean values.ReturnInt32: For 32-bit integers.ReturnInt64: For 64-bit integers.Unlike a native return statement in C# or C++, which is a language-level control flow keyword, cb.Return() is a method call that interacts with the uCalc engine's internal state. It effectively places the provided value onto the evaluation stack, allowing the engine to continue processing the expression. This distinction is crucial: the callback function itself is typically void in the host language, and cb.Return() is the designated channel for communicating results back to the parser.