Created
December 1, 2018 03:42
-
-
Save dangdennis/baa40ea6df009a0c7e00d8a1c29a401a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compiler error: You can convert a int to a string with string_of_int.*/ | |
let integer10: int = 10; | |
/* Proper use of typecast methods */ | |
let string10: string = string_of_int(10); | |
let boolean10: bool = bool_of_string("true"); | |
let float10: float = float_of_int(10); | |
let integer10Again: int = int_of_float(10.); | |
let integer5: int = int_of_char('a'); /* Converts character to ASCII decimal equivalent */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment