Scala Double !=(x: Float) method with example
Last Updated :
03 Sep, 2021
In Scala, Double is a 64-bit floating point number, which is equivalent to Java’s double primitive type. The !=(x: Float) method is utilized to check whether the given Double value and float are equal to each other or not.
Method Definition – def !=(x: Float): Boolean
Returns – Returns true if this value is not equal to x, false otherwise.
Example #1:
Scala
object GfG
{
def main(args : Array[String])
{
val result = ( 10.001254 ).toDouble.! = ( 10 : Float)
println(result)
}
}
|
Example #2:
Scala
object GfG
{
def main(args : Array[String])
{
val result = 11.86000000 .toDouble.! = ( 1296000.5 )
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...