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

Introduce Count unit #8

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@kokosing

kokosing commented Oct 31, 2018

Introduce Count unit

return new Count(size, unit).convertToMostSuccinctCount();
}
private final double value;

This comment has been minimized.

@dain

dain Nov 1, 2018

Member

Do we want an inexact value for this? IIRC, a single long would get us to 4000 quadrillion.

This comment has been minimized.

@kokosing

kokosing Nov 1, 2018

I was rather thinking about case where something could have fraction part (like water or mass). Though I do not have strong opinion. Would you like me to change this?

This comment has been minimized.

@dain

dain Nov 1, 2018

Member

I'm not sure. I can't think of any case where I would want to use this for non-integral counts. For water or mass, I assume we would introduce Volume and Mass units. Maybe @electrum or @martint have thoughts.

This comment has been minimized.

@kokosing

kokosing Nov 2, 2018

Notice that DataSize is also using double. Using double here is useful when doing a coversions between different units, like from KB to MB (as fractional part appears). The same happens for Count. When long is used then Count become precise more precise, but not all conversion are possible.

See #9.

This comment has been minimized.

@dain

dain Nov 3, 2018

Member

Oh good point.

@kokosing

This comment has been minimized.

kokosing commented Nov 5, 2018

Automation failure does not seem related.

@kokosing

This comment has been minimized.

kokosing commented Nov 5, 2018

@electrum Would you mind to take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment