Help (understand) convert small vector code to C#

I have found code, which packs float value into RGBA texture. I have founded a way to extract float value from my EXR depth texture on C# side. Now I need to pack into png image.

Original code is:

const vec4 bitSh = vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0,256.0, 1.0);
const vec4 bitMsk = vec4(0,1.0 / 256.0, 1.0 / 256.0,1.0 / 256.0);
vec4 comp = fract(depth * bitSh);
comp -= comp.xxyz * bitMsk;

I can easily emulate vec4 with C#.
But what about this fract(depth * bitSh) part?
What is actually going on in there?
And what comp.xxyz stands here for?

From what I found fract drops the integer part
If comp is say float4(1,2,3,4) then comp.xxyz would give you float4(1,1,2,3)

Thanks! I understand it completely now!