c - How is negative zero used in this context? -


struct in_addr ipv4;  ipv4.s_addr = (uint32_t)(-0) 

that's strange, arithmetic implemented through two's complement don't have negative representation of 0.

in one's complement version negative 0 instead stored 0xffffffff have 255.255.255.255 when converted ipv4 address after cast unsigned int.

while in normal architecture using -0 cast unsigned int should give 0x00000000.


Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -