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.
> (greater than) operator is a binary relational operator that evaluates whether the left operand is strictly greater than the right operand, yielding an untyped boolean value (true or false).
In Go, the > operator requires operands to be of an ordered type. Because Go enforces strict typing, the operands must adhere to one of the following typing rules:
- Same Concrete Type: Both operands are of the exact same typed ordered type. Implicit type coercion between different concrete types (e.g.,
int32andint64) is prohibited and yields a compile-time error. - Typed and Untyped: One operand is a typed variable and the other is an untyped constant. This is valid as long as the untyped constant is representable by a value of the typed operand’s type.
- Both Untyped: Both operands are untyped constants. In this scenario, they are evaluated exactly as untyped mathematical values using arbitrary precision. They do not need to be representable by any concrete Go type (e.g., values that would overflow a
float64can still be compared).
Syntax
Supported Ordered Types
The> operator is exclusively defined for types that possess a natural ordering:
- Integer types (
int,int8,uint32, etc.): Evaluates the mathematical integer value. - Floating-point types (
float32,float64): Evaluates the numeric value according to IEEE-754 standards.+Infis greater than any finite number.NaNcomparisons always evaluate tofalse. - String types: Evaluates lexicographically, comparing the underlying byte values sequentially from left to right.
Unsupported Types
The> operator cannot be used with unordered types. Attempting to use > with booleans, complex numbers, pointers, structs, arrays, slices, maps, channels, or interfaces will result in a compiler error.
Code Examples
Master Go with Deep Grasping Methodology!Learn More





