Retrieves the second argument passed to a callback function as a double-precision number.
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.
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:
This page last modified on: