Scala Int isWhole() method with example
The isWhole() method is utilized to return true if the specified int number is not having any decimal component, otherwise, it returns false.
Method Definition: (Int_Number).isWhole
Return Type: It returns true if the specified int number is not having any decimal component, otherwise, it returns false.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 5 ).isWhole
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 5.0 ).isWhole
println(result)
}
}
|
Last Updated :
30 Jan, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...