mathnet / mathnet-symbolics

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

Test checking output string fails in localized Windows #20

Closed tautologico closed 7 years ago

tautologico commented 7 years ago

Running tests on a Windows configured to a Brazil locale fails one test because the system uses comma for separating the integer and fractionary parts in a floating-point number, instead of a dot. Test output:

1) Failed : Tests.Constant Expressions
  String lengths are both 5. Strings differ at index 1.
  Expected: "3.2*x"
  But was:  "3,2*x"
FoggyFinder commented 7 years ago

well, it's easy to fix:

https://github.com/mathnet/mathnet-symbolics/pull/21

cdrnet commented 7 years ago

I wonder whether it is wise to allow such culture variation in this formal mathematical language. This would make it rather hard to support expression lists, e.g. to describe a matrix. Instead we could enforce the invariant culture everywhere (I'm actually surprised we're not doing this already).

tautologico commented 7 years ago

It's probably better to have invariant syntax anyway, as programming languages do.

cdrnet commented 7 years ago

@FoggyFinder what are your thoughts, would this work for you as well?

FoggyFinder commented 7 years ago

@cdrnet I agree, it's nice idea

tautologico commented 7 years ago

I believe this can be closed now, right?

cdrnet commented 7 years ago

Invariant culture is now enforced, released in v0.14.0.