Small ML Language
  • Small ML language
  • Installation
  • Hello World
  • Basics
    • Literals
    • Types
    • Type casting
    • Variables
    • Operators
    • Functions
    • Function chaining
    • Conditionals
    • Match
    • Arrays
    • Structs
    • Structure field Access
    • Enums
    • Enum Specialization
    • Object Destructuring
    • Modules
  • Compiler internals
    • SMLL to JAVA
Powered by GitBook
On this page
  1. Basics

Type casting

Casting from type to type

Type conversion is a useful feature to have in a programming language and SMLL is no different. To cast from type A to B use the as keyword.

(1 + 1) as Float 
200.5 as Int
"200" as Int
"10.500" as Double 

PreviousTypesNextVariables

Last updated 1 year ago