as (type casting)
Converts a number to another number type.
Syntax
value as type
Description
as is used for int↔float conversions. It is necessary before processing different types together.
Example
Loading editor…
Expected output
3.5
When to use?
Do not perform integer division for decimals.