todouble(), toreal()todouble(), toreal()
将输入转换为 real
类型的值。Converts the input to a value of type real
. (todouble()
和 toreal()
是同义函数。)(todouble()
and toreal()
are synonyms.)
toreal("123.4") == 123.4
备注
如果可能,最好使用 double() 或 real()。Prefer using double() or real() when possible.
语法Syntax
toreal(
Expr)
todouble(
Expr)
toreal(
Expr)
todouble(
Expr)
参数Arguments
- Expr:一个表达式,其值将转换为
real
类型的值。Expr : An expression whose value will be converted to a value of typereal
.
返回Returns
如果转换成功,则结果为 real
类型的值。If conversion is successful, the result is a value of type real
.
如果转换不成功,则结果为 real(null)
值。If conversion is not successful, the result is the value real(null)
.