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

MAX value for Unsigned8 #3

Open
hallo02 opened this issue Apr 3, 2017 · 1 comment
Open

MAX value for Unsigned8 #3

hallo02 opened this issue Apr 3, 2017 · 1 comment

Comments

@hallo02
Copy link

hallo02 commented Apr 3, 2017

Hey

In com.serotonin.bacnet4j.type.primitive.Unsigned8, Line 32
private static final int MAX = 0xff - 1;

This should be 0xff, isn't it?
8 bits, 2^8 = 256 possibilities,
so, 2^8 -1 = 255 = MAX Value = 0xff

@mlohbihler
Copy link
Collaborator

Yes, you are correct. A similar fix was made in Unsigned32. Unsigned16 looks to already be correct (although it may have been fixed recently). Thanks for pointing this out.

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

No branches or pull requests

2 participants