EvaluateToFloat - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Statistics

  

EvaluateToFloat

  

evaluate data using floating-point arithmetic

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

EvaluateToFloat(X)

Parameters

X

-

data sample

Description

• 

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.

Examples

> 

with⁡Statistics:

> 

A≔Array⁡3,3,1,a,b,a,π,sin⁡1,undefined,∞

A≔331abaπsin⁡1undefined∞

(1)

This will result in an error since A contains non-numeric data.

> 

EvaluateToFloat⁡A

Error, (in Statistics:-EvaluateToFloat) unable to evaluate a to floating-point

> 

B≔RemoveNonNumeric⁡A

B≔331πsin⁡1

(2)
> 

EvaluateToFloat⁡B

3.3.1.3.141592653589790.841470984807897

(3)
> 

C≔sin⁡1,sin⁡2,sin⁡3

C≔sin⁡1,sin⁡2,sin⁡3

(4)
> 

EvaluateToFloat⁡C

0.841470984807897,0.909297426825682,0.141120008059867

(5)
> 

U≔Array⁡C

U≔sin⁡1sin⁡2sin⁡3

(6)
> 

S≔EvaluateToFloat⁡U

S≔0.8414709848078970.9092974268256820.141120008059867

(7)
> 

UseHardwareFloats≔false

UseHardwareFloats≔false

(8)
> 

T≔EvaluateToFloat⁡U

T≔0.84147098480.90929742680.1411200081

(9)
> 

ArrayOptions⁡S,datatype

float8

(10)
> 

ArrayOptions⁡T,datatype

sfloat

(11)

See Also

Statistics

Statistics[Computation]

Statistics[DataManipulation]

Statistics[RemoveInRange]

Statistics[RemoveNonNumeric]

Statistics[SelectInRange]

Statistics[SelectNonNumeric]