A module for arithmetic with mixed radix numbers like time.
Ex: 1:20 + 2 hours & 41 mins = 4:01 or how it's represented in the code, [1, 20] + [2, 41] = [4, 1]

This module can handle digits of given numbers that are greater than the given bases
Ex: 9,000 minutes + 1 hour & 20 minutes = 6 days, 7 hours, & 20 minutes. 9,000 is beyond base 60, but [9000] + [1, 20] will still give the correct result, [6, 7, 20].

Numbers are represented as lists. 10 and -99 need to be converted into [1, 0] & [-9, 9]. Negative numbers have the most significant digit in the list as a negative.

For numbers with established representations like hexadecimal where 10 = a, there is no support for that kind of representation. All values are represented as their decimal equivalent. To work with hexadecimal, the numbers would have to be converted from [2, A, B] to [2, 10, 11]. This is to allow for massive bases like base 9,000 since there isn't really a single character representation for 9,000.

Features

  • add
  • subtract

Project Activity

See All Activity >

License

MIT License

Follow Mixed-Radix-Numbers

Mixed-Radix-Numbers Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Mixed-Radix-Numbers!

Additional Project Details

Programming Language

Python

Registered

2020-11-19