Statistics
EvaluateToFloat
evaluate data using floating-point arithmetic
Calling Sequence
Parameters
Description
Examples
EvaluateToFloat(X)
X
-
data sample
The EvaluateToFloat command evaluates to floating-point all elements in data. Each element of data can be any Maple expression, but this expression must be able to be evaluated to a floating-point number. Failure to evaluate to do so will generate an exception. By default the EvaluateToFloat attempts to represent the result using hardware data type. This can be changed by setting the UseHardwareFloats flag to false.
The first parameter X is a data sample - given as e.g. a Vector.
withStatistics:
A≔Array3,3,1,a,b,a,π,sin1,undefined,∞
A≔331abaπsin1undefined∞
This will result in an error since A contains non-numeric data.
EvaluateToFloatA
Error, (in Statistics:-EvaluateToFloat) unable to evaluate a to floating-point
B≔RemoveNonNumericA
B≔331πsin1
EvaluateToFloatB
3.3.1.3.141592653589790.841470984807897
C≔sin1,sin2,sin3
EvaluateToFloatC
0.841470984807897,0.909297426825682,0.141120008059867
U≔ArrayC
U≔sin1sin2sin3
S≔EvaluateToFloatU
S≔0.8414709848078970.9092974268256820.141120008059867
UseHardwareFloats≔false
T≔EvaluateToFloatU
T≔0.84147098480.90929742680.1411200081
ArrayOptionsS,datatype
float8
ArrayOptionsT,datatype
sfloat
See Also
Statistics[Computation]
Statistics[DataManipulation]
Statistics[RemoveInRange]
Statistics[RemoveNonNumeric]
Statistics[SelectInRange]
Statistics[SelectNonNumeric]
Download Help Document