If you are looking for such accuracy (where 50_000_000.00006 is different from 50_000_000.06) then you need a specialised library and do very careful coding.
If you are averaging bazillions of numbers and they range from weeny to huge and you thing 50_000_000.000006 != 50_000_000.06 for your purposes then it is hard for me to see that you are doing anything sensible.
This is, except in very specialised cases that I cannot imagine, a non issue.
Just add them up and divide, (and check for overflow, that could ruin your day!)
If you are averaging bazillions of numbers and they range from weeny to huge and you thing 50_000_000.000006 != 50_000_000.06 for your purposes then it is hard for me to see that you are doing anything sensible.
This is, except in very specialised cases that I cannot imagine, a non issue.
Just add them up and divide, (and check for overflow, that could ruin your day!)