Scala Byte /(x: Double): Double

Scala Byte /(x: Double): Double

在Scala中,Byte是一个8位带符号整数(相当于Java的byte原始类型)。 /(x: Double) 方法用于返回该值与x的商。

方法定义: Byte /(x: Double): Double
返回类型: 它返回该值与x的商。

例1:

// Scala program of Byte /(x: Double)
// method 
  
// Creating object 
object GfG 
{ 
  
    // Main method 
    def main(args:Array[String]) 
    { 
      
        // Applying Byte /(x: Double) function 
        val result = (64.toByte)./(12:Double) 
          
        // Displays output 
        println(result) 
      
    } 
}  

输出:

5.33333333

例2:

// Scala program of Byte /(x: Double)
// method 
  
// Creating object 
object GfG 
{ 
  
    // Main method 
    def main(args:Array[String]) 
    { 
      
        // Applying Byte /(x: Double) function 
        val result = (125.toByte)./(11:Double) 
          
        // Displays output 
        println(result) 
      
    } 
}  

输出:

11.363636363636363

更多Scala相关文章,请阅读:Scala 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程