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

Adjust Binary Parameter values to be rounded by midpoint. #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

regzo2
Copy link
Collaborator

@regzo2 regzo2 commented Nov 18, 2024

Adjusts a probable oversight where Binary Parameter bits would always round down to now be based on the midpoint of the parameter bit.

Changed function:

// BinaryBaseParameter.cs
var adjustedValue = Math.Abs(value);

To:

// BinaryBaseParameter.cs
var adjustedValue = Math.Abs(value) + (1f / _maxPossibleBinaryInt);

Resolves #241

@regzo2 regzo2 linked an issue Nov 18, 2024 that may be closed by this pull request
Copy link
Owner

@benaclejames benaclejames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

God it's been so long since I last looked at this code
If you've tested it and it works, good enough for me :p

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.

Unexpected Binary Parameters converting
2 participants