# Complex Numbers

**URL:** <https://forums.swift.org/t/complex-numbers/11929>\
**Category:** Pitches\
**Created:** [April 16, 2018, 6:44pm UTC](https://forums.swift.org/t/complex-numbers/11929 "2018-04-16T18:44:19Z")\
**Posts on this page:** 1\
**Showing post:** 121

<div class="post-metadata">

**Author:** ![scanon](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/scanon/32/2445_2.png) [@scanon](https://forums.swift.org/u/scanon)\
**Post date:** [November 28, 2018, 1:32am UTC](https://forums.swift.org/t/complex-numbers/11929/121 "2018-11-28T01:32:53Z")

</div>

Fractions are worse than both floating-point and fixed-point numbers is _almost_ every way. Most importantly:

- If you don't round results, in computations that aren't designed to work out _just so_, the size of the numerator and denominator is exponential in the number of terms in the computation.
- If you do round results, the result will generally be significantly less accurate than what you would get with an equivalently-sized fixed- or floating-point representation, because rationals are not uniformly spaced and have redundant representations.

The are legitimately useful for some computational geometry operations where the number of terms involved is tightly bounded, but those computations can also just be rephrased in terms of integers, so you don't really need a rational _type_ to implement them.

They're also real good at representing `1/3` exactly, which seems appealing, but has more psychological benefit than anything else.

---

_[View the full topic](https://forums.swift.org/t/complex-numbers/11929)._
