API reference
python:astx:astx.LiteralFloat
class LiteralFloat
LiteralFloat(value: str | Decimal, loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/literals/numeric.py:672
Declared as: python:astx:astx.literals.numeric.LiteralFloat
Exact decimal floating literal awaiting semantic contextualization.
Accept decimal text or Decimal, never an already-rounded Python float. The finite Decimal payload is independent of the active decimal context. Analysis must preserve it and record the chosen binary format and rounded constant in semantic metadata. Typed LiteralFloat32 and related nodes instead express an explicitly chosen binary format.
Attributes
-
value — Type: Decimal
-
type_ — Type: DataType
Methods
-
__init__ — Preserve an exact finite decimal value without binary rounding.
-
get_struct — Represent the exact value without introducing a JSON float.