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
1
2
3
4
5
6
7
8
9
10
11
# 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.