underlying()方法用于返回相同的指定浮点值。
函数定义: def underlying():AnyRef
返回类型: It returns the same specified float value.
范例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)  
        
    }  
}   
输出:
5.0
范例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)  
        
    }  
}   
输出:
100.9
相关用法
- Scala Int underlying()用法及代码示例
- Scala Float until(end: Float, step: Float)用法及代码示例
- Scala Float to(end: Float, step: Float)用法及代码示例
注:本文由纯净天空筛选整理自Kanchan_Ray大神的英文原创作品 Scala Float underlying() method with example。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
