mathnet / mathnet-symbolics

Math.NET Symbolics
http://symbolics.mathdotnet.com
MIT License
341 stars 66 forks source link

Approximation.Real vs FloatingPoint.Real #95

Open oluwandabira opened 2 years ago

oluwandabira commented 2 years ago

Trying to use this library from its documentation and I wrote this out:

#r "nuget: MathNet.Symbolics, 0.24.0"

open MathNet.Symbolics

open Operators

let x = symbol "x"

let y = symbol "y"

let xy = x * y

Evaluate.evaluate <| Map.ofList ["x", Real 2.0; "y", Real 5.0] <| xy

which I expect to work but the last line is invalid because Real evaluates to Approximation and not FloatingPoint, so I have to change the last line to

Evaluate.evaluate <| Map.ofList ["x", FloatingPoint.Real 2.0; "y", FloatingPoint.Real 5.0] <| xy

Am I doing something wrong that it infers the wrong Real?