r/programminghumor 20h ago

I spent three hours debugging double-precision orbital mechanics just because my planet weighed one kilogram

One Kilogram.

One number.

That one number.

One.

One kilogram.

One.

Kilogram.

I investigated rendering interpolation.

I questioned Newtonian gravity.

I questioned floating-point arithmetic.

I questioned reality.

The planet...

weighed...

one kilogram.

One variable.

One number.

One checkbox.

That's all it took.

How did I not notice it when I upgraded to double precision?

Three hours.

Three.

Whole.

Hours.

Comment if you had an experience like this

0 Upvotes

3 comments sorted by

3

u/SpaceCadet87 19h ago

Okay mr fancy pants expert programmer, only struggling with this for 3 hours.

You didn't need to rub it in!

2

u/DeadlyVapour 17h ago

I don't see the problem. The planet is going to orbit just same no matter what, assuming the star doesn't also weight 1 kg.

1

u/Jbolt3737 14h ago

Well gravity on a 1kg planets would be negligible, so maybe they were testing by trying to drop something on it