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 教程
极客教程