Scala Float底层()方法与示例
底层()方法用于返回相同的指定浮点值。
Method Definition: def underlying(): AnyRef
Return Type: It returns the same specified float value.
示例 #1:
// Scala program of Float underlying
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying underlying method
val result = (5.0).underlying
// Displays output
println(result)
}
}
输出:
5.0
示例 #2:
// Scala program of Float underlying
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying underlying method
val result = (100.9).underlying
// Displays output
println(result)
}
}
输出:
100.9