Scala Char %(x: Float) method with example
The %(x: Float) method is utilized to find the remainder of the division of the stated character 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 = 'E' . % ( 2.1 )
println(result)
}
}
|
Output:
1.7999999999999972
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = 'B' . % ( 4.5 )
println(result)
}
}
|
Last Updated :
03 Nov, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...