Skip to content

Commit 1b5f693

Browse files
committed
Add Rationale section to README.md
1 parent 781ad3d commit 1b5f693

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,23 @@ f5 := f1.Multiply(f2) // 1/3
3030
f6, err := f1.Divide(f2) // 3/4, nil
3131
```
3232

33-
You can also convert a fraction to a float, or vice versa, using the `Float64` and `FromFloat64` functions:
33+
You can also convert a fraction to a float, or vice versa, using `Float64` and `FromFloat64` functions:
3434

3535
```go
3636
floatValue := f1.Float64() // 0.5
3737
f7, err := fraction.FromFloat64(0.5) // 1/2, nil
3838
```
3939

40+
### 🤔 Rationale
41+
The Fraction type in go-fractions aims to provide a lightweight, primitive-like representation of fractions. As a
42+
result, it has limitations in terms of precision and can overflow when performing certain operations. If you need a
43+
type that can represent all rational numbers without regard for memory and CPU consumption, consider using the
44+
`big.Rat` type from the standard library.
45+
46+
Please note that these limitations should not be an issue for most use cases, and go-fractions provides a convenient
47+
and efficient way to work with fractions in Go. However, it is important to be aware of these limitations and choose
48+
the appropriate type based on your specific needs.
49+
4050
## 📜 Documentation
4151
For more detailed documentation and a full list of functions, see the
4252
[reference page](https://pkg.go.dev/github.com/nethruster/go-fraction).

0 commit comments

Comments
 (0)