Data Types
Anonymous contributor
Published Jul 23, 2021Updated Oct 19, 2021
Contribute to Docs
All programming languages designate certain ātypesā of data. This helps the operating system and computer hardware allocate memory based on the type of data that is going to be stored.
Emojicode, being a very type-safe language, takes great care to ensure that data types are understood, by both you and the compiler.
Here are a few basic data types in Emojicode:
Type | Description |
---|---|
š¢ |
Integer numbers |
šÆ |
Decimal numbers |
š” |
Text strings |
š |
Truth values š /š |
š² Type Casting
Type casting is a way to determine whether a value is of a given type at run-time and to treat the value as an instance of this type.
š² value type
The value
is the value to be casted to type
:
- If
value
can be casted totype
, thenvalue
is returned astype
. - If it canāt, then no value is returned.
Type casting is implemented with the š²
statement:
š² hello š” š Tries to cast txt to š”š² world š š Tries to cast a to š
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Emojicode on Codecademy
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Emojicode
š Learn about Emojicode, a programming language that consists of emojis! šBeginner Friendly1 hour