triforcely / Octave.NET

📈 More than cross-platform Octave process wrapper 🔬
MIT License
32 stars 7 forks source link

Minus infinity in matrix potential fix #3

Closed CptWesley closed 5 years ago

CptWesley commented 5 years ago

Why?

Currently when a result from Octave is being parsed as a scalar -Inf becomes double.MinValue. However, when -Inf is within a matrix or vector it becomes double.MaxValue. I doubt this was intentional and I assumed it was supposed to be double.MinValue as well, to be able to differentiate from Inf.

What?

triforcely commented 5 years ago

You are right, this was not intentional and I'm ashamed that I did not create a test case for that.

But before I accept this PR - since ParseDouble() does all the checking, I noticed that logic in AsScalar() is redundant. Could you refactor it?

CptWesley commented 5 years ago

Sure thing

triforcely commented 5 years ago

Very nice, thank you!

triforcely commented 5 years ago

New nuget release will be created later this week.