# Extend FloatingPoint with tau!

**URL:** <https://forums.swift.org/t/extend-floatingpoint-with-tau/3188>\
**Category:** Discussion\
**Created:** [June 29, 2016, 7:45am UTC](https://forums.swift.org/t/extend-floatingpoint-with-tau/3188 "2016-06-29T07:45:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hartbit](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hartbit/32/738_2.png) [@hartbit](https://forums.swift.org/u/hartbit)\
**Post date:** [June 29, 2016, 7:45am UTC](https://forums.swift.org/t/extend-floatingpoint-with-tau/3188/1 "2016-06-29T07:45:06Z")

</div>

Hello community,

Tau day \<[http://tauday.com/&gt](http://tauday.com/&gt); was yesterday, and reminded me that we forgot to provide a `tau` next to `FloatingPoint`’s `pi` property. How about we write a proposal to brind this forward-thinking constant to a forward-thinking language?

Proposal: Extend `FloatingPoint` with tau

&nbsp;&nbsp;/// The mathematical constant tau = 6.28318...  
&nbsp;&nbsp;///  
&nbsp;&nbsp;/// Extensible floating-point types might provide additional APIs to obtain  
&nbsp;&nbsp;/// this value to caller-specified precision.  
&nbsp;&nbsp;static var tau: Self { get }

David.

---

<div class="post-metadata">

**Author:** ![iachievedit](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/iachievedit/32/28605_2.png) [@iachievedit](https://forums.swift.org/u/iachievedit)\
**Post date:** [June 30, 2016, 1:12pm UTC](https://forums.swift.org/t/extend-floatingpoint-with-tau/3188/2 "2016-06-30T13:12:18Z")

</div>

I would argue the reverse, i.e., removing pi as a property of  
FloatingPoint. What is it there vs. being part of a separate mathematic  
constants package? I don't see Euler's number or phi (golden ratio) in the  
proposal.

Joe

> **···**
>
> On Wed, Jun 29, 2016 at 2:45 AM, David Hart via swift-evolution \< swift-evolution@swift.org\> wrote:
> 
> > Hello community,
> > 
> > Tau day \<[http://tauday.com](http://tauday.com)\> was yesterday, and reminded me that we forgot  
> > to provide a `tau` next to `FloatingPoint`’s `pi` property. How about we  
> > write a proposal to brind this forward-thinking constant to a  
> > forward-thinking language?
> > 
> > \*Proposal: Extend `FloatingPoint` with tau\*
> > 
> > &nbsp;&nbsp;/// The mathematical constant tau = 6.28318...  
> > &nbsp;&nbsp;///  
> > &nbsp;&nbsp;/// Extensible floating-point types might provide additional APIs to  
> > obtain  
> > &nbsp;&nbsp;/// this value to caller-specified precision.  
> > &nbsp;&nbsp;static var tau: Self { get }
> > 
> > David.
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> 
> --  
> Joseph Bell  
> [http://dev.iachieved.it/iachievedit/](http://dev.iachieved.it/iachievedit/)  
> @iachievedit

---

<div class="post-metadata">

**Author:** ![Stephen\_Canon](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stephen_canon/32/7220_2.png) [@Stephen\_Canon](https://forums.swift.org/u/Stephen_Canon)\
**Post date:** [June 30, 2016, 3:22pm UTC](https://forums.swift.org/t/extend-floatingpoint-with-tau/3188/3 "2016-06-30T15:22:23Z")

</div>

This was discussed as part of SE-0067.

The consensus was that pi deserved special treatment, as it is used in general-purpose code an order of magnitude more often than the all other constants combined. I don’t think that anyone argued against it’s inclusion.

– Steve

> **···**
>
> > On Jun 30, 2016, at 9:12 AM, Joseph Bell via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > I would argue the reverse, i.e., removing pi as a property of FloatingPoint. What is it there vs. being part of a separate mathematic constants package? I don't see Euler's number or phi (golden ratio) in the proposal.
> > 
> > Joe
> > 
> > On Wed, Jun 29, 2016 at 2:45 AM, David Hart via swift-evolution \<swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>\> wrote:  
> > Hello community,
> > 
> > Tau day \<[http://tauday.com/&gt](http://tauday.com/&gt); was yesterday, and reminded me that we forgot to provide a `tau` next to `FloatingPoint`’s `pi` property. How about we write a proposal to brind this forward-thinking constant to a forward-thinking language?
> > 
> > Proposal: Extend `FloatingPoint` with tau
> > 
> > &nbsp;&nbsp;/// The mathematical constant tau = 6.28318...  
> > &nbsp;&nbsp;///  
> > &nbsp;&nbsp;/// Extensible floating-point types might provide additional APIs to obtain  
> > &nbsp;&nbsp;/// this value to caller-specified precision.  
> > &nbsp;&nbsp;static var tau: Self { get }
> > 
> > David.
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > --  
> > Joseph Bell  
> > [http://dev.iachieved.it/iachievedit/](http://dev.iachieved.it/iachievedit/)  
> > @iachievedit  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![Joe\_Groff](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joe_groff/32/1929_2.png) [@Joe\_Groff](https://forums.swift.org/u/Joe_Groff)\
**Post date:** [June 30, 2016, 4:49pm UTC](https://forums.swift.org/t/extend-floatingpoint-with-tau/3188/4 "2016-06-30T16:49:35Z")

</div>

'2 \* x' is a precise operation (assuming it doesn't overflow the exponent), so '2 \* .pi' will always be as accurate as '.pi' itself.

-Joe

> **···**
>
> > On Jun 30, 2016, at 9:01 AM, David Waite via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > > On Jun 30, 2016, at 9:22 AM, Stephen Canon via swift-evolution \<swift-evolution@swift.org\> wrote:
> > > 
> > > This was discussed as part of SE-0067.
> > > 
> > > The consensus was that pi deserved special treatment, as it is used in general-purpose code an order of magnitude more often than the all other constants combined. I don’t think that anyone argued against it’s inclusion.
> > 
> > To me, it also makes sense to offer a common transcendental constant with the highest precision available to a particular floating point type.

---

<div class="post-metadata">

**Author:** ![dwaite](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dwaite/32/1200_2.png) [@dwaite](https://forums.swift.org/u/dwaite)\
**Post date:** [June 30, 2016, 4:01pm UTC](https://forums.swift.org/t/extend-floatingpoint-with-tau/3188/5 "2016-06-30T16:01:23Z")

</div>

To me, it also makes sense to offer a common transcendental constant with the highest precision available to a particular floating point type.

-DW

> **···**
>
> > On Jun 30, 2016, at 9:22 AM, Stephen Canon via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > This was discussed as part of SE-0067.
> > 
> > The consensus was that pi deserved special treatment, as it is used in general-purpose code an order of magnitude more often than the all other constants combined. I don’t think that anyone argued against it’s inclusion.
