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

Other Useful Business Software
Enterprise-grade ITSM, for every business Icon
Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity.

Freshservice is an intuitive, AI-powered platform that helps IT, operations, and business teams deliver exceptional service without the usual complexity. Automate repetitive tasks, resolve issues faster, and provide seamless support across the organization. From managing incidents and assets to driving smarter decisions, Freshservice makes it easy to stay efficient and scale with confidence.
Try it Free
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