Scala Int /(x: Long) 方法及示例

Scala Int /(x: Long) 方法及示例

/(x: Long) 方法用于返回指定 int 值与 long 值相除时的商。

方法定义:(Int_Value)./(Long_Value)

返回类型:返回指定 int 值与 long 值相除时的商。

示例 #1:

// Scala program of Int /(x: Long)
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying Int /(x: Long) function
        val result = (100)./(10)
          
        // Displays output
        println(result)
      
    }
} 
10

示例 #2:

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

阅读更多:Scala 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程