Coder Social home page Coder Social logo

adamwhitehat / mixedradixcalculator Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 2.0 190 KB

Creates a counting system of radixes such as base 12 or mixed radixes such as Minutes/Hours/Days/Years (60/60/24/365)

Home Page: http://www.csharpprogramming.tips/2015/10/mixed-radix-numeral-system-class-and.html

C# 100.00%
polynomials data-structures mixed-radixes math mathematics numeral number-theory

mixedradixcalculator's Introduction

MixedRadixCalculator - 52:7:24:60:60:1000

Screenshot

A numeral system (or system of numeration) is a writing system for expressing numbers.

The most familiar one is of course the decimal numeral system. This is a 10-base numbering system. Computers use a binary numeral system. The base is sometimes called the radix or scale. Not all numbering systems have just one base. Take for example, how we currently divide time: There are 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day, and 365 days in a year. This is called a mixed radix numeral system, and one might express the above mixed radix system like: 365:24:60:60. I choose the left side to be the most significant side. This is merely a personal preference, and my MixedRadixSystem class supports displaying both alignments. Another feature lies in my RadixNumeral class. Each numeral, or place value, supports having its own dictionary of symbols

https://en.wikipedia.org/wiki/Mixed_radix . http://mathworld.wolfram.com/Base.html

My 'Mixed Radix Calculator' creates a counting system of radices (plural of radix), such as base 12 or mixed radices such as Minutes/Hours/Days/Years (60/60/24/365).

Uses: I haven't found a lot of use cases for it yet, but it is interesting. I originally built this because I wanted to experiment with numeral systems that uses increasing consecutive prime numbers for each radix, as well as experiment with some off-bases, such as base 3 or base 7.

In a single base, say base 7, then 'round numbers' with only one place value having a 1 and the rest having zeros, such as 1:0:0:0:0 (in base 7), such numbers are powers of 7, and ever other number except for the 1's place value is a multiple of 7.

A mixed radix numeral system can represent a polynomial, and possibly provide for a simpler way to visualize and reason about them.

Yet another possible use is to make a numeral system with a base that is larger than and co-prime to some other target number (say 256) to make a bijective map from every value in a byte to some other value exactly once by repeatedly adding the value of the co-prime, modulus 256. This can appear rather random (or sometimes not at all) but the mapping is easily determined given the co-prime. I have talked about this notion before on my blog https://csharpcodewhisperer.blogspot.com/search/label/Coprime

If you like this project you would probably like my project EquationFinder, it finds equations given constraints https://github.com/AdamWhiteHat/EquationFinder

mixedradixcalculator's People

Contributors

adamwhitehat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mixedradixcalculator's Issues

Negative base support?

๐Ÿ™ƒ

************** Exception Text **************
System.ArgumentOutOfRangeException: Value must be a positive number.
Parameter name: DecimalValue
   at RadixCalculator.MixedRadixSystem.RadixNumeral.Increment(BigInteger DecimalValue)
   at RadixCalculator.MixedRadixSystem.RadixNumeral.Increment(BigInteger DecimalValue)
   at RadixCalculator.MixedRadixSystem.RadixNumeral.Increment()
   at RadixCalculator.MixedRadixSystem.Increment()
   at RadixCalculator.MainForm.BtnIncrementClick(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
RadixCalculator
    Assembly Version: 1.0.6913.35720
    Win32 Version: 1.0.6913.35720
    CodeBase: file:///[REDACTED]/RadixCalculator.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2612.0 built by: NET471REL1LAST_B
    CodeBase: file:///[REDACTED_%windir%]/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

๐Ÿ™‚

Releases/Builds?

Any releases/builds of this available anywhere? Your website seems dead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.