Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 1.88 KB

README.md

File metadata and controls

27 lines (23 loc) · 1.88 KB

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