The sum of tpwgts for constraint #0 is not 1.0

I'm trying to partition a graph into a large number of partitions (using ParMETIS_V3_PartKway).
I set tpwgts with this code:

for (unsigned int i = 0; i < nPartitions; i++)
tpwgts[i] = 1./nPartitions;

This works fine in most cases. However, if I want to create 147456 partitions, I get the error message:
The sum of tpwgts for constraint #0 is not 1.0

This is probably a numerical issue. Does anybody now to solve this?

Best regards,
Sebastian