toreal()
Learn how to use the toreal() function to convert the input expression to a value of type
real.Converts the input expression to a value of type real.
Syntax
toreal(Expr)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| value | scalar | ✔️ | The value to convert to real. |
Returns
If conversion is successful, the result is a value of type real. Otherwise, the returned value is real(null).
Example
The following example checks whether the input "123.4" was converted to the real value.
toreal("123.4") == 123.4
Related content
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.