# Edge case enum

**URL:** <https://forums.swift.org/t/edge-case-enum/68181>\
**Category:** Using Swift\
**Tags:** string, enums, unicode\
**Created:** [November 1, 2023, 2:08am UTC](https://forums.swift.org/t/edge-case-enum/68181 "2023-11-01T02:08:02Z")\
**Posts on this page:** 1\
**Showing post:** 15

<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:** [November 1, 2023, 3:48pm UTC](https://forums.swift.org/t/edge-case-enum/68181/15 "2023-11-01T15:48:31Z")

</div>

Found the equivalent edge case that doesn't use Strings and behaves exactly the same way:

```swift
enum F: Double {
    case x = -0.0
    case y = 0.0
}

var x = F.x
var y = F.y
var xraw = x.rawValue
var yraw = y.rawValue
print(xraw == yraw) // true
dumpHex(&x, MemoryLayout.size(ofValue: x)) // 00
dumpHex(&y, MemoryLayout.size(ofValue: y)) // 01
dumpHex(&xraw, MemoryLayout.size(ofValue: xraw)) // 00 00 00 00 00 00 00 80
dumpHex(&yraw, MemoryLayout.size(ofValue: yraw)) // 00 00 00 00 00 00 00 00
print(x == y) // true! unexpected

```

---

_[View the full topic](https://forums.swift.org/t/edge-case-enum/68181)._
