# About SE-307: Is the implicit Double to CGFloat conversion a performance hit on 64 bit platforms?

**URL:** <https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581>\
**Category:** Using Swift\
**Tags:** performance, uikit, double, cgfloat\
**Created:** [June 30, 2022, 12:05pm UTC](https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581 "2022-06-30T12:05:32Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![mayoff](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mayoff/32/613_2.png) [@mayoff](https://forums.swift.org/u/mayoff)\
**Post date:** [July 6, 2022, 6:14pm UTC](https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581/22 "2022-07-06T18:14:04Z")

</div>

I would like to propose the `SexagesimalFloatingPoint` protocol and, in Swift 5⅚, change `CGFloat` to conform to it…

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [July 6, 2022, 6:52pm UTC](https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581/23 "2022-07-06T18:52:11Z")

</div>

> [@ksluder](#):
>
> some form of rational coordinates

I'd love to see fractional coordinates used in future APIs. Comparing coordinates for equality and uniform precision across the whole range of values is more important for graphics API than ability to represent values like 1e±300. Modern CPUs should be fast enough to handle it.

---

<div class="post-metadata">

**Author:** ![ksluder](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@ksluder](https://forums.swift.org/u/ksluder)\
**Post date:** [July 6, 2022, 6:54pm UTC](https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581/24 "2022-07-06T18:54:49Z")

</div>

> [@tera](#):
>
> Modern CPUs should be fast enough to handle it.

I suspect not. Especially when rasterizing Bézier paths. Such a system would probably require lowering to IEEE floats at some point.

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [July 6, 2022, 7:02pm UTC](https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581/25 "2022-07-06T19:02:43Z")

</div>

You mean it won't be possible to calculate square or cubic roots of those fractional numbers directly, or it would be too slow, or it would involve a back and forth translation between those and floats? hmm. Someone must have tried that already? Anyone knows a modern precedent?

[Previous page](https://forums.swift.org/t/about-se-307-is-the-implicit-double-to-cgfloat-conversion-a-performance-hit-on-64-bit-platforms/58581.md?page=1)
