numred 0.1.0

A library to reduce any number to just one digit. The numred function takes an &u64 and returns an u8.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 3.49 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 992.31 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • arkaitz-dev

numred

A library to reduce any number to just one digit. The numred function takes an &u64 and returns an u8. It operates this way:

Given a number like 12, it returns 3 Given a number like 10, it returns 1 Given a number like 123, it returns 6

So, it sums each digit with the result of the previous ones, and if it is greater than 10, it sums also this two digits (11 -> 2, 12 -> 3 and so on).

Corrections are welcome. Just contact me for any suggestion.