Difference between revisions of "Core.Terms.ToFloat"
Jump to navigation
Jump to search
m (Hb moved page ToFloat to Core.Terms.ToFloat: #3153) |
|||
Line 1: | Line 1: | ||
− | [[Category:Core]] | + | {{DISPLAYTITLE:OTX '''ToFloat'''}}[[Category:Core]] |
== Classification == | == Classification == | ||
{{ClassificationActivity | ToFloat | To convert an expression to a Float | [[Term]] | [[Core|OTX Core library]] | [[Conversion terms]] | - | - }} | {{ClassificationActivity | ToFloat | To convert an expression to a Float | [[Term]] | [[Core|OTX Core library]] | [[Conversion terms]] | - | - }} | ||
Line 11: | Line 11: | ||
Term to the convert an expression to a Float. | Term to the convert an expression to a Float. | ||
− | {{TermReturnValue| [[Float]] | Return value of the appropriate type.}} | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.Float|Float]] | Return value of the appropriate type.}} |
== Rules == | == Rules == | ||
Line 23: | Line 23: | ||
*: Returns the float value of the ByteFields. The interpretation according to '''IEEE 754:1985'''. | *: Returns the float value of the ByteFields. The interpretation according to '''IEEE 754:1985'''. | ||
* '''String''' | * '''String''' | ||
− | *: Returns the float value of the string. The string must correspond to a [[FloatLiteral]]. If not, an exception is thrown. | + | *: Returns the float value of the string. The string must correspond to a [[Core.Terms.FloatLiteral|FloatLiteral]]. If not, an exception is thrown. |
== Properties == | == Properties == | ||
Line 45: | Line 45: | ||
== See also == | == See also == | ||
− | [[ToBoolean]] <br/> | + | [[Core.Terms.ToBoolean|ToBoolean]] <br/> |
− | [[ToInteger]] <br/> | + | [[Core.Terms.ToInteger|ToInteger]] <br/> |
− | [[ToByteField]] <br/> | + | [[Core.Terms.ToByteField|ToByteField]] <br/> |
− | [[ToString]] | + | [[Core.Terms.ToString|ToString]] |
Revision as of 05:28, 5 February 2016
Contents
Classification
Name | ToFloat |
Short Description | To convert an expression to a Float |
Class | Term |
Extension | OTX Core library |
Group | Conversion terms |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
Pseudo-Code Syntax
FLoatTerm = COnversion.ToFloat(Term);
Description
Term to the convert an expression to a Float.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Float | Return value of the appropriate type. |
Rules
- Boolean
- Returns 1.0, if true , otherwise 0.0
- Integer
- Returns a float copy of the value
- Float
- Returns a copy of the value
- ByteField
- Returns the float value of the ByteFields. The interpretation according to IEEE 754:1985.
- String
- Returns the float value of the string. The string must correspond to a FloatLiteral. If not, an exception is thrown.
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Term | - | Term | - | [1] | The expression to be converted. Rules, see description. |
Examples
Float Float1;
Float Float2;
Float Float3;
Float Float4;
Float1 = Conversion.ToFloat(true);
Float2 = Conversion.ToFloat("1234");
Float3 = Conversion.ToFloat(123);
Float4 = Conversion.ToFloat(&18 00 FF FF);