3 ms·
Easy! # not happening unless developer consumes a large number # of drugs distance_miles = 42 launch_rocket(distance_km: distance_miles*1.6) A
by Swizec 4y ago
Easy!
# not happening unless developer consumes a large number
# of drugs
distance_miles = 42
launch_rocket(distance_km: distance_miles*1.6)
Aaaand we're off by 0.3924km. Enough to fit 4 football fields with a few meters left over. Oopsies
Units are hard. Never under-estimate the ability of programmers to think they're converting but get it slightly wrong.
- deleted 4y ago[deleted]
- sgtnoodle 4y agoIt's within a significant digit of the specified distance, though. A few football fields of error seems pretty good to me for 42 miles. What's the required accuracy and precision for this rocket launching system?
- Swizec 4y agoWell if it’s a boom rocket for war, the expected precision these days is the size of a car if not smaller. I think even dumb gravity bombs in ww2 were more precise than “a few football fields”
- Symbiote 4y agoRussia has been criticised and ridiculed for bombing civilian targets when they are presumed to be aiming for military targets a block away.
- JohnBooty 4y agoI qualified my answer with a "95%" because yeah, I think it's good enough about that often. If we're launching physical rockets then yeah, I would agree that that is probably not a job for dynamic typing.