ReturnDbl

Method

Sets the double-precision floating-point return value for a custom function or operator implemented via callback.

Product: 

Class: 

Warning

uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.

Syntax

ReturnDbl(double)

Parameters

value
double
The double-precision value to be returned from the callback to the uCalc engine.

Return

void

This method does not return a value.

Remarks

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.

Type-Specific Returns

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.

Comparative Analysis

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.

Examples

This page last modified on: 

8/21/2026