Happy Pi Day!

In celebration of Pi Day, I'm thrilled to share with you all a mathematical delight—a Pi Calculator written in the Swift language. This nifty tool not only calculates Pi to your desired number of digits but also showcases the power and elegance of Swift for complex numerical computations.

`Number`

does just that! Focusing on ease-of-use, API clarity, and Swift's progressive disclosure, Number's simple set of structs and enums model the various types of numeric concepts, ranging from the everyday to the scientific. Here's just a slice of the whole proposal:

# Number

## Introduction

`Numeric`

types are messy. Swift has a multitude of `Numeric`

types: `UInt8`

, `UInt16`

, `UInt32`

, `UInt64`

, `Int8`

, `Int16`

, `Int32`

, `Int64`

, `Float`

, `Float16`

, `Double`

. As well as types that take on platform-specific meaning (`UInt`

, `Int`

) or may not even exist on some platforms or architectures, such as: `Float80`

. All of this before we even look outside the standard library to types such as: `CGFloat`

, `Decimal`

or `NSNumber`

. These types are not interoperable and often require explicit conversions or coercions to perform arithmetic operations or to pass them as arguments to functions.

This proposal introduces a comprehensive `Number`

type with `String`

-like simplicity for numeric values, dramatically simplifying the use of numbers and enabling advanced scientific computation.

[...]

## Proposed solution

`Number`

itself is a `String`

-like type, built around a simple enumeration responsible for marshalling work to a series of specialized components.

```
enum Number {
case real(RealNumber)
case imaginary(ImaginaryNumber)
case complex(ComplexNumber)
}
```

`String`

does this with `Character`

and `StaticString`

. `String`

does not care what the underlying `Character`

s are, whether Latin script, Arabic, Kanji or Emoji; one can quickly and easily compose a `String`

containing all of them. `Number`

embraces this paradigm. Whether actually a `NaturalNumber`

, `IrrationalNumber`

or `ComplexNumber`

; `Number`

's operations return a `Number`

containing the *exact result*, every time.

## [...]

You can test Number today by downloading from github or by it's package with:

```
.package(url: "https://github.com/hexleytheplatypus/swift-se0000-number.git", from: "1.0.1"),
```

And adding Number to your dependencies:

```
.product(name: "SE0000_Number", package: "swift-se0000-number"),
```

Then importing it:

```
import SE0000_Number
```

Check out computing the pi approximation in the test file.

I believe that by enhancing Swift's numerical capabilities, we can unlock new potentials and applications. We can make Swift the go-to language for not only app development but also for scientific and mathematical computing.

Happy Pi Day once again! Don't forget to check out the whole proposal, comment and ask questions here or with a direct message.