IntegerValue#
- class IntegerValue(value)#
Bases: numpy.int64
, ansys.tools.variableinterop.variable_value.IVariableValue
Stores a value as an IntegerValue
variable type.
Overview#
Invoke the visitor pattern of this object using the passed-in visitor |
|
Convert the value to an API string. |
|
Convert this |
|
Convert the value to a formatted string. |
Variable type of the object. |
Create an |
Import detail#
from ansys.tools.variableinterop.scalar_values import IntegerValue
Property detail#
- property IntegerValue.variable_type: VariableType#
Variable type of the object.
- Returns:
VariableType
Variable type of the object.
Method detail#
- IntegerValue.accept(visitor: ansys.tools.variableinterop.ivariable_visitor.IVariableValueVisitor[ansys.tools.variableinterop.ivariable_visitor.T]) ansys.tools.variableinterop.ivariable_visitor.T #
Invoke the visitor pattern of this object using the passed-in visitor implementation.
- Parameters:
- visitor
IVariableValueVisitor
Visitor object to call.
- visitor
- Returns:
T
Results of the visitor invocation.
- IntegerValue.to_api_string(context: ansys.tools.variableinterop.isave_context.ISaveContext | None = None) str #
Convert the value to an API string.
- Returns:
str
String appropriate for use in files and APIs.
- IntegerValue.to_real_value() RealValue #
Convert this
IntegerValue
type to aRealValue
type.Because a
RealValue
type is a 64-bit floating point number, it has a 52-bit mantissa. That means that a portion of the range of 64-bitIntegerValue
types cannot be completely accurately represented byRealValue
types. This conversion is sometimes lossy forIntegerValue
types of sufficient magnitude.- Returns:
RealValue
RealValue
type with the same numeric value as theIntegerValue
type.
- static IntegerValue.from_api_string(value: str) IntegerValue #
Create an
IntegerValue
type from an API string.Leading and trailing whitespace is ignored. Values that can be correctly parsed as floating-point numbers are parsed in that manner and then rounded to integers. When rounding, values with a 5 in the tenths place are rounded away from zero.
- Parameters:
- value
str
String to parse.
- value
- Returns:
IntegerValue
IntegerValue
type parsed from the API string.