|
The type casted ints are actually not changed but type cast and works that way.
I would try to explain in a bit better real time example
Lets say you have purchased a Laptop from USA and a charger for that Laptop is which only works in a 110 Volt situation.
Now you move to a place like say India where we have 220 Volt as normal and hardly find 110 Volt thing.
Now what you can do.
1. Change the Laptop
2. Change the Power Supply System
3. Use an Adapter which works in both environment and converts one form to the other.
This is what is done in here.
It actually takes int as input converts them float and performs the operation and returns int back.
It does not solve the issue if there is any about trancate but then the issue is not with truncate which is addressed here but the issue is with the operator knows only float and we know only int and so how we can use the Math Library to do our operation. We Adapt .
|