- Installing
- Hello World
- Spaces
- Identation
- Basics
- Comments
- Output
- ++ method
- Assignments and types
- Operator Precedence
- String interpolation
- Input
- Simple arithmetic
- Multiline strings
- Assert
- Arrays and literal arrays
- Literal intervals
- If, for, while and repeat-until
- Message sends
- Conversion between basic type values
- Anonymous functions
- Evaluating an anonymous function
- Functions with method foreach
- Prototypes
- Packages
- Gradual typing
- Generic prototypes
- Important metaobjects
- The CyanInterpreter prototype
Simple arithmetic
Types Byte, Short, Int, Long, Float, and Double support almost the same set of arithmetical and logical operators as the corresponding types of Java. Types Float and Double do not support methods &, |, ~|, and !. All basic types are automatically included in every Cyan source code because they belong to package cyan.lang.
The list below shows us the basic aritmethic and logical operators
func eq: (Dyn other) -> Boolean func neq: (Dyn other) -> Boolean func + (Int other) -> Int func - (Int other) -> Int func * (Int other) -> Int func / (Int other) -> Int func % (Int other) -> Int func < (Int other) -> Boolean func <= (Int other) -> Boolean func > (Int other) -> Boolean func >= (Int other) -> Boolean