Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1971: Boolean meaning 0.00001 = true, 0.00000 = false #1990

Merged
merged 1 commit into from
May 7, 2017

Conversation

Dunbaratu
Copy link
Member

Fixes #1971

I moved the code out of abstract class ScalarValue
into the classes that override it, because I wanted
to use a simple cast operator and to do that I need
to know the type of Value at compile-time.

I could have just used C#'s own knowledge of how you're
meant to "convert" numbers to Booleans by doing
Convert.ToBoolean(Value) in ScalarValue. It would have
given the same result, but I think this way is a bit faster
because it casts instead of using Convert methods.

I moved the code out of abstract class ScalarValue
into the classes that override it, because I wanted
to use a simple cast operator and to do that I need
to know the type of Value at compile-time.

I could have just used C#'s own knowledge of how you're
meant to "convert" numbers to Booleans by doing
Convert.ToBoolean(Value) in ScalarValue.  It would have
given the same result, but I think this way is a bit faster
because it casts instead of using Convert methods.
@Dunbaratu Dunbaratu added this to the v1.1.0 milestone Apr 21, 2017
@hvacengi hvacengi self-assigned this Apr 29, 2017
@hvacengi hvacengi merged commit c71010a into KSP-KOS:develop May 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants