Skip to content

Contains some functionality regarding primes and base-n representation of numbers.

License

Notifications You must be signed in to change notification settings

Narumikazuchi/Math

Repository files navigation

Logo

Tests Tests NuGet

Introduction

The functionalities that are implemented here are mostly just for the purpose of 'building it myself'. It was a fun challenge to build formatters for base-3, base-5 and base-7 number representations, which are also p-adic numbers due to the base being a prime number. Speaking of prime numbers, there is also a generator for prime numbers in this library, just in case one is needed.

Contents

Upon looking at the signatures of the classes their capabilities should be clear at a glance. They are also documented, so there should be little confusion as to how they are used. A little side node for the PrimeInteger, since this struct has an implicit conversion, it can throw runtime exceptions for wrong parameters while also providing a clear signature of was a method expects. For example public void Foobar(PrimeInteger prime) clearly conveys the intent and what the method expects as parameter.

  1. Prime Stuff
    1. static class PrimeGenerator
    2. struct PrimeEnumerator
    3. readonly struct PrimeInteger
  2. Formatters
    1. interface IIntegerFormatter<TInteger>
    2. interface IFloatingPointFormatter<TFloatingPoint>
    3. sealed class RomanIntegerFormatter
    4. sealed class ThreeAdicIntegerFormatter
    5. sealed class ThreeAdicFloatingPointFormatter
    6. sealed class FiveAdicIntegerFormatter
    7. sealed class FiveAdicFloatingPointFormatter
    8. sealed class SevenAdicIntegerFormatter
    9. sealed class SevenAdicFloatingPointFormatter

Releases

No releases published

Packages

 
 
 

Languages