Scala Float /(x: Float) 方法示例
/(x: Float)方法用于返回指定的第一个浮点值除以第二个浮点值时的商。
Method Definition: (First_Float_Value)./(Second_Float_Value)
Return Type: It returns the quotient when the specified first float value is divided by second float value.
示例 #1:
// Scala program of Float /(x: Float)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying /(x: Float) function
val result = (100.0)./(50.0)
// Displays output
println(result)
}
}
输出:
2.0
示例 #2:
// Scala program of Float /(x: Float)
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying /(x: Float) function
val result = (110.0)./(50.0)
// Displays output
println(result)
}
}
输出:
2.2