Open In App

Scala Long !=(x: Float) method with example

Last Updated : 02 Nov, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
In Scala, Long is a 64-bit signed integer, which is equivalent to Java's long primitive type. The !=(x: Float) method is utilized to check whether the given Long value is 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
// Scala program to explain working 
// of Long !=(x: Float) function

// Creating object
object GfG
{ 

    // Main method
    def main(args:Array[String])
    {
    
        // Applying !=(x: Float) function
        val result = (10).toLong.!=(10.0)
        
        // Displays output
        println(result)
    
    }
} 
Output:
false
  Example #2: SCALA
// Scala program to explain working
// of Long !=(x: Float) function

// Creating object
object GfG
{ 

    // Main method
    def main(args:Array[String])
    {
    
        // Applying !=(x: Float) function
        val result = 1186000000.toLong.!= (1296000.5)
        
        // Displays output
        println(result)
    
    }
} 
Output:
true

Next Article
Article Tags :
Practice Tags :

Similar Reads