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
Top-Rated Free CRM Software Icon
Top-Rated Free CRM Software

216,000+ customers in over 135 countries grow their businesses with HubSpot

HubSpot is an AI-powered customer platform with all the software, integrations, and resources you need to connect your marketing, sales, and customer service. HubSpot's connected platform enables you to grow your business faster by focusing on what matters most: your customers.
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