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 64-bit integer value from a uCalc variable.
The 64-bit integer value of the variable.
The ValueInt64() method provides a direct, type-safe way to retrieve the value of a uCalc variable defined as a 64-bit integer (Int64 or Int64u).
This method is the counterpart to the ValueInt64 setter. It is used to access the current value of a variable from the host application, typically after it has been manipulated by a uCalc expression or set programmatically.
### 🆚 Comparative Analysis: Why Use a Type-Specific Getter?While uCalc offers several ways to retrieve a variable's value, `ValueInt64()` is the best choice for 64-bit integers due to performance and data integrity.1. **`ValueInt64()` (Type-Safe Getter - Recommended)** * **Pros**: Fastest method, returns the exact binary value without conversion, and preserves the full precision of 64-bit integers. * **Cons**: Specific to one data type. * **Best for**: Performance-critical code and handling large numbers like timestamps, database IDs, or financial calculations.2. **`Value()` (Generic Getter - Potential Precision Loss)** * This method always returns a `double`. While convenient, a `double` only has about 15-17 decimal digits of precision. A 64-bit integer can have up to 19 digits. Using `Value()` on large `Int64` values **will result in precision loss**. * **Best for**: General-purpose numeric retrieval where maximum precision is not critical.3. **`ValueStr()` (String-Based Getter)** * This method returns the value as a string. It preserves precision but is slower due to the overhead of converting the number to a string and subsequent parsing if you need to use it as a number in your host application. * **Best for**: Displaying values or when a string representation is the desired final format.In summary, always use `ValueInt64()` to retrieve `Int64` or `Int64u` variables to guarantee both speed and data integrity.