A little detailed DIY explanation.
I'm assuming you have some background in some of the 'C' standards and you are using a standard compliant compiler that could work with floating point numbers. I'm also assuming you are not looking for ignoring the fraction from the result completely - like floor().
Having said that, the result of a floating point conversion normally cannot be a 'unsigned long', at least without conversion. So, I would do something like considering the number of significant digits in the fraction from the floating point result and ignore the rest while converting it into 'unsigned long'. Now, the considered fraction digits could be from binary, decimal or hexadecimal formats.
As an example, assuming gain is in decimal and rest are hexadecimal, the result of your equation is:
0x3E7.FFB0B36BC == 999.998789991 decimal.
Depending upon my choice of retaining 4 hex digits from fraction, my result in 'unsigned long' would be:
0x3E7FFB0 = 65535920 decimal.
Now it would be a little different if I would like to choose 4 decimal digits instead of four hex digits - I would get 999.9987. But I think you get the idea.
Also note, some compilers use 24-bit floating point format. You might need to read your compiler documentation. Other useful place is Wikipedia:
https://en.wikipedia.org/wiki/IEEE_floating_point