Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
phaedrus
on June 10, 2014
|
parent
|
context
|
favorite
| on:
Types Are The Truth
If the language supports union, then simply give your working variable the type of "union { float, long }". This directly expresses the idea that you're working with a piece of memory that is used for two purposes.
TheLoneWolfling
on June 10, 2014
[–]
If the language supports untagged unions, it isn't strongly typed. With very few exceptions.
tomp
on June 10, 2014
|
parent
[–]
Untagged unions between two non-pointer types with the same representation (same number of bits) are perfectly safe, they are just ordinary bit-casts.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: