Open In App

Scala Float underlying() method with example

Last Updated : 30 Jan, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

The underlying() method is utilized to return the same specified float value.

Method Definition: def underlying(): AnyRef

Return Type: It returns the same specified float value.

Example #1:




// Scala program of Float underlying
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        // Applying underlying method  
        val result = (5.0).underlying
            
        // Displays output 
        println(result) 
        
    
}   


Output:

5.0

Example #2:




// Scala program of Float underlying
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        // Applying underlying method  
        val result = (100.9).underlying
            
        // Displays output 
        println(result) 
        
    
}   


Output:

100.9


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads