Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olyutorskii/doubdabc
DoubDabC is a Java library that supports binary integer value to decimal sequence conversion with alternative algorithm.
https://github.com/olyutorskii/doubdabc
algorithm alternative-algorithm base-conversion bcd conversion dda decimal digits double-dabble-algorithm gc-friendry java java-library number radix
Last synced: 3 days ago
JSON representation
DoubDabC is a Java library that supports binary integer value to decimal sequence conversion with alternative algorithm.
- Host: GitHub
- URL: https://github.com/olyutorskii/doubdabc
- Owner: olyutorskii
- License: mit
- Created: 2017-01-02T06:48:09.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2023-10-04T08:45:26.000Z (about 1 year ago)
- Last Synced: 2023-10-04T18:13:44.782Z (about 1 year ago)
- Topics: algorithm, alternative-algorithm, base-conversion, bcd, conversion, dda, decimal, digits, double-dabble-algorithm, gc-friendry, java, java-library, number, radix
- Language: Java
- Homepage:
- Size: 614 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DoubDabC #
![Java CI with Maven](https://github.com/olyutorskii/DoubDabC/workflows/Java%20CI%20with%20Maven/badge.svg)
![CodeQL](https://github.com/olyutorskii/DoubDabC/workflows/CodeQL/badge.svg)-----------------------------------------------------------------------
## What is DoubDabC ? ##
* **DoubDabC** is a Java library
that supports **binary integer value to decimal sequence conversion**
with alternative algorithm.* Yes, it will substitute implementations such as
`Integer.toString(int)` and so on.## DoubDabC implementation ##
* DoubDabC implements **[Double-Dabble algorithm][DDA]**
aka **Shift-and-add-3**.
Double-Dabble is a radix-conversion algorithm
but there is no division\(/\) nor remainder\(%\) operation.
It's a bit fast.* There is no String constructor during conversion.
That means, **GC-friendry !**## Supported Input ##
* DoubDabC has a pseudo register of the size you specified.
You can put N-bit bool, `int`, `long`, `BitSet`, or `BigInteger`
as binary integer value.* Let's try to put a huge Mersenne prime like `2^32582657 -1`.
Overflow ? OK, don't worry.
Just losing higher decimals over you specified.## Supported Output ##
* You can get each decimal number column result by `int` or `int[]` array.
* You can assign
`Appendable`, `Writer`, `StringBuffer`, `StringBuilder`, or `CharBuffer`
as Arabic numeral characters\(0-9\) sequence output.* `CharSequence` wrapper class is provided.
## Limitations ##
* DoubDabC does not support negative values.
Signed-values are treated as Unsigned-value
like `Integer.toUnsignedString(int)`.
Let's convert absolute value that follows minus\(-\) sign.## What is the difference with [**JarabraDix**][JDX] ? ##
* If you use binary integer value that fit in 'long' or 'int',
and you have modern JVM and CPU that supports fast integer division,
let's try **JarabraDix**.## How to build ##
* DoubDabC needs to use [Maven 3.3.9+](https://maven.apache.org/)
and JDK 1.8+ to be built.* DoubDabC runtime does not depend on any other library at all.
Just compile Java sources under `src/main/java/` if you don't use Maven.## License ##
* Code is under [The MIT License][MIT].
## Project founder ##
* By [olyutorskii](https://github.com/olyutorskii) at 2017
## Key technology ##
- [Double-Dabble algorithm][DDA]
- [Binary-coded decimal (Packed BCD)][PBCD]
- [Bi-quinary coded decimal][BQCD]
- [Left-shift operation with freesize pseudo register][LSFT][DDA]: https://en.wikipedia.org/wiki/Double_dabble "Double-Dabble algorithm"
[PBCD]: https://en.wikipedia.org/wiki/Binary-coded_decimal#Packed_BCD "Packed Binary coded decimal"
[BQCD]: https://en.wikipedia.org/wiki/Bi-quinary_coded_decimal "Bi-quinary coded decimal"
[LSFT]: https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts "Left shift"
[JDX]: https://github.com/olyutorskii/JarabraDix
[MIT]: https://opensource.org/licenses/MIT--- EOF ---