Add absoluteValue#21
Conversation
|
For what it's worth, I think the utility of this is pretty niche and would be okay having to write it downstream. |
|
I actually don't think this function should be in the library anymore. The need to perform such an operation makes very little sense in the context of a byte size. I only do it for sorting by the largest delta. |
|
I added the From my understanding, there should be an easy way to derive the absolute value from a negative value. |
|
Yeah I get that, but it's a weird operation to perform on a byte size in general. I don't really mind it being there, of course, since I will use it, but I also think it's perfectly reasonable to force something like this on user code. |
|
Released as part of https://github.com/saket/byte-size/releases/tag/2.2.0. Thanks again! |
Refs https://github.com/JakeWharton/diffuse/blob/a36b7b563d2435d431b26e85a03dc19d95fcd7d5/io/src/main/kotlin/com/jakewharton/diffuse/io/Size.kt#L18-L19.