Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanFredriksson authored Dec 9, 2024
1 parent 34dbe73 commit fb84061
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,27 @@ float mandelbrot() {
return 0.0;
}
```

### Encoding
Numbers are encoded using an array of unsigned integers (uint) in the following format:
### Sign (index 0):
- 0: The number is **non-negative**
- 1: The number is **negative**
#### Whole Value (index 1):
- Represents the whole (integer) part of the number
#### Fractional Values (indices 2, 3, ...):
- Each subsequent element represents fractional values that are 2^32 times smaller than the previous one.

### Examples
#### Positive Whole Number (e.g., 42):
```csharp
[0, 42]
```
#### Negative Decimal Number (e.g., -42.5):
```csharp
[1, 42, 2147483648] // 2147483648 represents 0.5 as 2^31 = 2147483648
```
#### Really Small Fractional Number (e.g., 5.42101086243e-20)
```csharp
[0, 0, 0, 1]
```

0 comments on commit fb84061

Please sign in to comment.