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


toreal(Expr) todouble(Expr)toreal(Expr) todouble(Expr)


  • Expr:一个表达式,其值将转换为 real 类型的值。Expr: An expression whose value will be converted to a value of type real.


如果转换成功,则结果为 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).

注意:如果可能,最好使用 double() 或 real()Note: Prefer using double() or real() when possible.