Scala Int ^(x: Double)方法及示例

Scala Int ^(x: Double)方法及示例

^(x: Double) 方法用于返回int值和指定double值按位异或运算的结果。

方法定义:(Int_Value).^(Double_Value)

返回类型:它返回int值和指定double值按位异或运算的结果。

示例 #1:

// Scala program of Int ^(x: Double)
      // method

      // Creating object
      object GfG
      { 

          // Main method
          def main(args:Array[String])
          {

              // Applying Int ^(x: Double) function
              val result = (15).^(2)

              // Displays output
              println(result)

          }
      } 
13

示例 #2:

// Scala program of Int ^(x: Double)
      // method

      // Creating object
      object GfG
      { 

          // Main method
          def main(args:Array[String])
          {

              // Applying Int ^(x: Double) function
              val result = (15).^(3)

              // Displays output
              println(result)

          }
      } 
12

阅读更多:Scala 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程