How does the actual variable, fraction32, get mapped into the union?
fraction32 is (presumably; its definition is not shown in the question) an object in memory of type unsigned long, and unsigned long is hopefully the same size as float in this C implementation.
&fraction32 takes the address of that object. The result is a pointer of type unsigned long *.
(map *) &fraction32 converts that pointer to a pointer of type map *. In most C implementations, the resulting pointer points to the same memory. However, this is not required by the C standard,1 so the code is not strictly conforming.
Since the type of (map *) &fraction32 is map *, * (map *) &fraction32 says to access that memory as if it were a map object. Thus, if the pointer does point to the memory of fraction32, the bytes in that memory are interpreted as if they were a map object.2
(* (map *) &fraction32).output says to take the output member of that union. In C, reading any member of a union reinterprets the bytes of the union using the type of the member. So this reinterprets the bytes, originally of fraction32, as if they were a float.
Nonetheless, a better way of reinterpreting an unsigned long as a float in C is to use a compound literal:
return (map) { float32 } .output;
Footnotes
1 There are two problems with converting an unsigned long * to map *: The unsigned long might not have the alignment required for a map (but this is unlikely in typical C implementations) and the C standard does not specify what value results from this conversion is except that it can be converted back to the original type to produce the original pointer or equivalent. This is an argument that the compiler must generate code that generates the desired value because an unsigned long * in general could be a pointer to a member of a map *, and converting a pointer to a member of a union to a pointer to the union type is specified to produce a pointer to the union. But that argument does not cover the case where the compiler can see the unsigned long * does not point to an actual member of the union.
2 Some people might say that this access to the union is undefined behavior due to C’s aliasing rules. However, accessing the unsigned long named float32 using map conforms to the aliasing rules. C 2024 6.5 says that an object may be accessed by “an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union),” and map is a union type that includes unsigned long among its members.2 If the code had been * (float *) &float32, then the aliasing rules would be violated.
3 It should be noted that the C standard is unclear on whether a.b is an access to the union a, after which b is extracted, or it is a direct access to the member b. If it is the former, the aliasing rules are satisfied. If it is the latter, the aliasing rules are violated. But the latter would also mean most reads of union members violate aliasing rules, but that is clearly not the intent of the standard since footnote 93 in C 2024 6.5.3.4 indicates that reinterpreting the bytes of a union using any member type is intended.
(map*)is a cast to convertfraction32, which is presumably along, to afloat. I'm refraining from answering because it's right on the edge of undefined behavior, and there are better contributors here to evaluate that. The current top answer to this question states this is a violation of strict aliasing.unsigned longthrough afloattype would violate C’s aliasing rules. However, the code in this question accesses anunsigned longthrough a union, and it is a union that contains anunsigned longmember, and that is specifically allowed in C’s aliasing rules.return ((map){fraction32}).output;instead. (use a compound literal)typedefdoes. Union types are types, regardless oftypedef. Whattypedefdoes is define an alias for a type's name, including if the type does not have a name of its own.