Scala Short -(x: Float) method with example
Last Updated :
11 Nov, 2019
The -(x: Float) method is utilized to find the difference of the stated Short value and ‘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 = ( 1000 ).-( 13.7 )
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = (- 1000 ).-( 17.9 )
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...