We want to report the time in seconds, rather than milliseconds. the time in seconds is likely Since to have a non - zero fractional part, we will store the time as a variable that we call "float ll seconds. in our calculation of seconds, we will use what is known as explicit casting to tell the compiler to convert an int value to a float value. by the doing this, we ensure we will obtain the fractional part. if we didn "t do this, and we asked the computer to perform an arithmetic operation that involved only int" s, the computer would return an int result (and any fractional part would be lost). in addition to explicit casting, where we specify the conversion that is to be done, there is what is known as implicit also casting. this is conversion that the compiler does as it follows certain rules. for example, if an arithmetic expression contains both an int and float value, the compiler will first implicitly convert the int to a float and then perform the operation. Reliance on implicit casting can be a source of bugs, so it is explicit casting am the best to use when casting is necessary.
번역되고, 잠시 기다려주십시오..
