Module arithmetic

Source

Functionsยง

check_mixed_arithmetic_operation
Checks if mixed-type arithmetic operations are allowed, particularly handling unspecified literals that can be coerced to match the other operandโ€™s type. This function handles type coercion for arithmetic operations when operands have different types.
check_same_type_arithmetic
Checks if a type is compatible with an arithmetic operation when both operands have the same type. Boolean types are not allowed for any arithmetic operation. String types are only allowed for the Add operator (concatenation). Unit types and function types are not allowed for any arithmetic operation.
check_unspecified_float_for_type ๐Ÿ”’
Checks if an unspecified float literal is in the valid range for a target type. This is used when coercing a float literal to a specific float type.
check_unspecified_int_for_type ๐Ÿ”’
Checks if an unspecified integer literal is in the valid range for a target type. This is used when coercing an integer literal to a specific integer type.
is_float_type ๐Ÿ”’
Helper function to check if a type is a float type. This includes all floating-point types but not unspecified floats.
is_integer_type ๐Ÿ”’
Helper function to check if a type is an integer type. This includes all signed and unsigned integer types but not unspecified integers.