Lesson 3 – C++ int to Double – explicit cast

Let's discuss the c++ int to double and explicit casting. Without the casting a strange kind of math occurs -- one that might surprise your math teacher. int x=1, y=2;double z;z = double(x) / y; /* We look at the double data type it can hold #'s with decimal points Programmer: Jane Doe Cause : C++ Int to Double, explicit cast Date : May 2020 */ #include <iostream> using namespace std; int...
Read More