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 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.
using uCalcSoftware;
var uc = new uCalc();
// Define a 64-bit integer variable
var myId = uc.DefineVariable("myId As Int64");
// Set its value
myId.ValueInt64(9007199254740991);
// Retrieve its value using the type-safe getter
int64_t retrievedId = myId.ValueInt64();
Console.WriteLine($"Retrieved ID: {retrievedId}");
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.
ValueInt64() (Type-Safe Getter - Recommended)
Value() (Generic Getter - Potential Precision Loss)
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.ValueStr() (String-Based Getter)
In summary, always use ValueInt64() to retrieve Int64 or Int64u variables to guarantee both speed and data integrity.
This page last modified on: