Scala Short %(x: Float) method with example
Last Updated :
11 Nov, 2019
The %(x: Float) method is utilized to find the remainder of the division of the stated Short value by ‘x’ of type Float.
Method Definition: def %(x: Float): Float
Return Type: It returns Float.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = ( 995 ). % ( 2.1 )
println(result)
}
}
|
Output:
1.699999999999958
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = ( 449 ). % ( 4.5 )
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...