From the course: Programming Foundations: Discrete Mathematics
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Datatypes
From the course: Programming Foundations: Discrete Mathematics
Datatypes
- [Instructor] Discrete math contains many topics that can be demonstrated using SML. Topics include: functions and recursion. As part of the foundations of programming segment, let's use SML to model some discrete math concepts. If I enter five and a semicolon and hit enter, SML tells me the value of the variable is five, and it's an integer. Notice, I didn't give the value a variable name. SML automatically uses it, or I-T, as the variable name. Let's try it again. Let's put a number in that has a decimal point. This time SML says the value is a real number. How about if I enter a string? Most programing languages use double quotes around a string, so I'll enter my name, and SML works the same way. An expression in SML is any construct in the programming language that the program interpreter can evaluate to a value. So let's start with a simple expression. Let's take away three from 15, so 15 minus three. The SML…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.