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:
Retrieves the second argument passed to a callback function as a double-precision number.
The second argument as a double-precision floating-point number. Returns 0 if fewer than two arguments were passed.
The Arg2() method is a high-performance shortcut for retrieving the second argument passed to a callback function. It is functionally identical to calling Arg(2) but avoids the overhead of passing an index, making it slightly more efficient.
This method is primarily a convenience for callbacks linked to binary operators or functions that take exactly two numeric arguments. It complements Arg1(), which retrieves the first argument.
Arg2() specifically retrieves the argument as a double. If you need to access arguments of other types, use the corresponding type-safe methods:
In many languages like C# or C++, a callback or delegate signature explicitly names its parameters:
// Standard C# delegatepublic delegate double MathOperation(double operand1, double operand2);uCalc uses a different architectural pattern. The callback receives a single, unified Callback object (cb), and you use methods like Arg1() and Arg2() to retrieve arguments by position from that object. This model offers several advantages: