News for hackers. Stuff that matters.
Re:Types Are The Truth by phaedrus on Tuesday June 10, 2014 @02:56PM (#7874589)
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.
Re:Types Are The Truth by TheLoneWolfling on Tuesday June 10, 2014 @03:00PM (#7874608)
If the language supports untagged unions, it isn't strongly typed. With very few exceptions.
Re:Types Are The Truth by tomp on Tuesday June 10, 2014 @04:47PM (#7875224)
Untagged unions between two non-pointer types with the same representation (same number of bits) are perfectly safe, they are just ordinary bit-casts.