EMERGING TRENDS IN COMPUTING
ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
What is the return value of trunc()?
|
int
|
|
bool
|
|
float
|
|
none
|
Explanation:
Detailed explanation-1: -TRUNC removes the fractional part of the number. INT rounds numbers down to the nearest integer based on the value of the fractional part of the number. INT and TRUNC are different only when using negative numbers: TRUNC(-4.3) returns-4, but INT(-4.3) returns-5 because-5 is the lower number.
Detailed explanation-2: -The trunc() Function This function is used to truncate double type value. And return only the integer part.
Detailed explanation-3: -trunc() method returns the integer part of a number. The Math. trunc() method removes the decimals (does NOT round the number).
There is 1 question to complete.