Sign in Join
FPDoc Onlineexperiment

TMathOperation class

In unit fpExprPars

Internally used class for mathematical operations in expressions

Declaration

pascal
TMathOperation = class(TFPBinaryOperation)

Inheritance

  1. TMathOperation
  2. TFPBinaryOperation
  3. TFPExprNode
  4. TObject

Descends from it: TFPAddOperation TFPDivideOperation TFPModuloOperation TFPMultiplyOperation TFPPowerOperation TFPSubtractOperation

Description

The TMathOperation class serves as a base class for mathematical operations that can be performed on numeric operands. It provides common functionality for arithmetic operations including type checking and result type determination.

Mathematical operations support various numeric types including integers, floats, and currency values, with automatic type promotion to ensure precision is maintained in calculations. The class ensures that operands are compatible for mathematical operations.

This class is used internally by the TFPExpressionParser class to construct an AST (Abstract Syntax Tree). There is normally no need for you to use or instantiate this class directly.

See also

Methods

CheckpublicValidate the mathematical operation for correctness
NodeTypepublicGet the result type for mathematical operations

Inherited

From TFPBinaryOperation (8)

CheckSameNodeTypes Create Destroy HasAggregate InitAggregate left Right UpdateAggregate

From TFPExprNode (5)

AsString CheckNodeType GetNodeValue IsAggregate NodeValue

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.