TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
< (less than) operator is a binary relational operator that evaluates whether the left operand is strictly smaller in value than the right operand. It yields an untyped boolean value (true or false).
Type Constraints
In Go, the< operator strictly requires both operands to be of the same ordered type. Go does not perform implicit type coercion between distinct concrete types. If the operands are of different types, the compiler will throw a mismatched types error unless one or both are untyped constants that can be implicitly converted to a common type.
Supported Ordered Types and Evaluation Mechanics
- Integer Types (
int,uint,int8,byte, etc.): Evaluates the standard mathematical value. Signed and unsigned integers are evaluated according to their respective bitwise representations. - Floating-Point Types (
float32,float64): Evaluates numerical value according to the IEEE-754 standard.- Positive zero (
+0.0) and negative zero (-0.0) are considered equal, so-0.0 < +0.0isfalse. - If either operand is
NaN(Not a Number), the result is alwaysfalse.
- Positive zero (
- String Types: Evaluates lexicographically byte-by-byte, not by rune or locale. The operator compares the raw byte values at each index. If all bytes match up to the length of the shorter string, the shorter string is evaluated as less than the longer string.
Unsupported Types
The< operator is not defined for unordered types. Attempting to use < with the following types results in a compile-time error:
- Booleans
- Complex numbers (
complex64,complex128) - Pointers
- Channels, Interfaces, Maps, Slices, Arrays, and Structs
Syntax Visualization
Master Go with Deep Grasping Methodology!Learn More





