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:
Returns the first argument passed to a callback function as a double-precision number.
The double-precision floating-point value of the first argument.
The Arg1 method is a high-performance shortcut for retrieving the first (or only) argument passed to a Callback function. It is functionally identical to calling Arg(1) but is slightly more efficient as it avoids the overhead of an indexed lookup.
This method is exclusively used within the body of a callback function that has been registered with DefineFunction or DefineOperator. It simplifies the implementation of unary functions and operators where only one input is expected.
In most languages, accessing function arguments involves indexing into an array or list.
args[0] in a params object[] args array, but Arg1 is type-specific and avoids the casting and indexing steps.va_list.uCalc provides Arg1 (and its counterpart Arg2) as a convenience that leads to cleaner and more readable callback code, especially for simple mathematical operations. It reinforces the contract that a particular callback expects a specific number of arguments.
For arguments of other data types or for accessing arguments by a dynamic index, use the general-purpose Arg method or its type-specific variants like ArgStr or ArgInt32.