Talk:Square root algorithms: Difference between revisions

Content deleted Content added
Undid revision 1072186602 by 2600:4040:500C:1C00:CD83:34B:5FF1:895F (talk) Remove talk page chat per wp:TPG
Line 63:
:I tried to fix it. Is it OK now? [[User:JRSpriggs|JRSpriggs]] ([[User talk:JRSpriggs|talk]]) 22:57, 22 December 2021 (UTC)
:: Yes, now OK [[User:Jumpow|Jumpow]] ([[User talk:Jumpow|talk]]) 21:33, 4 January 2022 (UTC)
 
== Undefined behaviour ==
 
The examples using unions are invalid C, as they invoke undefined behaviour. An easy solution that is probably even clearer for the purpose of example code would be to use memcpy, e.g.
 
float f;
uint32_t u;
memcpy (&u, &f, sizeof (u));