Orders of Magnitude, Precision

Hi. I'm considering using Box2d but I have specific requirements. The faq recommends using meters/kilograms/seconds, which I understand. I can convert from my units to Box2d just fine. If I have objects that are 50m in size I can scale them down to 50cm using a scaling factor.

However, it also suggests keeping things between 100mm and 100m (a difference of 3 orders of magnitude.) I have worlds that are up to 50,000km to a side with objects as small as 5m to a side (a difference of 7 orders of magnitude.) If I had objects between 100m and 100km I would just use a scaling factor, but there's no single scaling factor that can fit both 5m and 50,000,000m into that same scale. I can try to minimize the problem by limiting the worlds to, say, 5,000km to a side but after that B2D loses its appeal.

Can B2D handle such large distances with such small objects? Would there be issues with internal precision? Floats, for example, generally don't give more than 6 or 7 digits of precision, and I'm looking for more like 10 digits of precision.

In case you're curious, I'm making a space battle game where ships are, say, 50 meters long and in realistic orbits around realistic planets, and I'd like to have each region around a planet/moon/etc be its own B2D world. I imagine I would even have B2D worlds orbiting stars! Whee!
I believe those guidelines are for dynamic objects, so they would apply to your spaceships at least. For the planets though, will these be bumping around against each other? Will a 50m sized spaceship bump into a planet and knock it flying? If not, I'm thinking you could use kinematic bodies for the planets or even static bodies, and just fake movement of the whole world/region by simply rendering it gradually moving.

Yes, precision issues will probably show up but that's not really a Box2D specific thing. You could try defining the 'float32' type used by Box2D as double instead of float, that would help.
You're right -- a planet or moon or similar would always be at the centre of the B2 world. The largest dynamic objects would be on the neighborhood of 10-15km, which isn't that bad. It's only the distances that would get very large.

Has anyone had any experience with precision in B2D, or with defining the float to be a double internally?

Original thread: https://box2d.org/forum/viewtopic.php?t=8308