>> DAVID MALAN: So how can we solve this problem?
Well, the easiest way is just to avoid ints altogether, and instead define
one float by a float.
Specifically, let's change 1 to 1.0 and 10 to 10.0, and then save this
file as floats1.c.
Let's now compile it with make floats1, and then run it with floats1.
And now, I indeed see 0.1.
>> There's another way we could solve it, and that's using casting.
Casting is the process of converting one data type to another, assuming it
makes sense to do so.
In this case, what I could do is go back to the version of code where I'm
dividing one in int by 10 in int, but I could explicitly tell the compiler
that I want to treat 1 as though it's a float, even though it's an int, and
I'd like to treat 10 as a float, even though it, too, is an int.
>> In reality, I could get away with just casting one of these to a float,
because if you divide a float by an int, or an int by a float, C will
return to you a floating point value.
But in this case, for good measure, I'll convert both to floats, recompile
my program with make floats1, then run it with dot slash floats1,
and I also see 0.1.