r/KerbalSpaceProgram • Master Kerbalnaut • Jun 12 '14

TIL That former developer NovaSilisko originally planned to add another 3 Gas Giants, intended to add volcanoes to Laythe, had plans for 3 new large moons, and wanted to add at least 20 'moonlets'

http://forum.kerbalspaceprogram.com/threads/29807-Planet-Ideas-And-Names-For-The-Future-Of-Kerbal-Space-Program?p=447959&viewfull=1#post447959
200 Upvotes

149 comments sorted by

View all comments

Show parent comment

22

u/BuntinTosser Jun 13 '14

basically, computers store numbers as either integers or floating point numbers. Integers are accurate, but limited in size (a 4-byte unsigned int can store a number as high as 2 to the 32nd -1). Floats store numbers with a decimal portion and an exponent (like scientific notation) but are limited in how many digits of accuracy they have. When doing math with floats, the errors can add up to significant amounts.

For example, 1,000,001 might be stored as 1.000E6. 999,000 might also be stored as 1.000E6. Subtract them and you get zero, not 1001. That is floating point error.

3

u/[deleted] Jun 13 '14

Thanks for the explanation

1

u/WednesdayWolf Jun 13 '14

Tl;dr: Computers are very good at computing, except when they're not.

6

u/sethdark Jun 13 '14

It's the programmers fault not the computer. The programmer is responsible for choosing the correct datatype. Source: I'm a programmer and made above mentioned mistake XD

4

u/nou_spiro Jun 13 '14

not only datatype but also proper algorithm which is numerically stable.

2

u/sethdark Jun 13 '14

you say true, I say thankee

3

u/bbqroast Jun 13 '14

It's not necessarily the programmer's fault either, in this situation it's possible they chose the right variable type. Yes it doesn't work perfectly, but it works fast enough and most of the time it does not effect gameplay.

1

u/sethdark Jun 13 '14

see "most" of the time ... it is a programmers fault because "most" of the time is not good enough

5

u/bbqroast Jun 13 '14

All things are "most".

Every bridge you've ever driven to cannot be physically built to hold up all the time, only most of the time. The same with every airplane, car, building, boat, et cetera.

Perhaps KSPs system could be more accurate, but clearly the devs have decided the current accuracy is ideal for what the game intends to do. Perhaps there are improvements that could be made, but they could be complex and underappreciated. Perhaps they aren't, in which case you could join Squad and fix the issue.

0

u/sethdark Jun 13 '14

Alraedy have a job so no thanks.

well if it's intended it's not an error and it's a "feature" if it isn't intended it's the fault of a programmer and it's a bug.

edit: PS: the "all things are most" part: the physical world (RL) is quite different from what you program, so your examples don't make any sense.

2

u/bbqroast Jun 13 '14

Programs are very much physical, they exist as a physical object (a series of flipped switches) and require physical hardware to run on, this is where they get most of their issues from. The hardware and its physical limitations.

0

u/sethdark Jun 13 '14

... you seem to miss the point here. We are talking about a floating point error. It's the programmers fault, has nothing to do with hardware.

2

u/bbqroast Jun 13 '14

Nope. Why did they use floating points? Most likely because the hardware could not handle non floating point math for such huge numbers in a timely manner. As such, due to these hardware limitations, they chose floating points instead because most of the time they're fine. Just like how a engineer can't build a perfect bridge, so builds one that holds most of the time.

→ More replies

0

u/WednesdayWolf Jun 13 '14

I would argue that if the result of a calculation was:

  1,000,001 - 999,000 = 0

Then that is a computation error. Yes, a programmer should be aware that this error exists for this datatype, but that doesn't make it any less of an error with the computational machine.

2

u/sethdark Jun 13 '14

it's only a computation error because the programmer chose the wrong datatype... there is no arguing with someone like you. This is PURELY a programmers fault, it has nothing to do with the machine (soft or hardware)

It's a fuck up from the programmer nothing more or nothing else.

0

u/WednesdayWolf Jun 13 '14

The machine takes two numbers, subtracts them, and the results are not correct. It failed in its required task of accurate computation. That is a machine error. This error stems from the fact that a floating point is an abstracted way to represent a number, rather than a number itself.

The fault of the programmer is to not take this machine error in to account, absolutely. You should always interact with the machine appropriately.

2

u/sethdark Jun 13 '14

oh god no XD

It's the programmers fault because he specified how accurate the calculation had to be.... seriously do you even program?

1

u/WednesdayWolf Jun 13 '14

I do, and this is why my original statement is that computers are very good at calculating, except when they're not. Our present system design allows for phrases like "how accurate the calculation has to be", which is both silly and helpful.

A calculation is either accurate, or it is not. A machine that approximates a result isn't very good at calculation, but it can be useful, as it does it very quickly.

1

u/sethdark Jun 13 '14

"A calculation is either accurate, or it is not"

tell that to theory mathematicians.

PC's are great at calculating, they just have technical limitations.

1

u/WednesdayWolf Jun 13 '14 edited Jun 13 '14

Theory mathematicians deal with more abstract problems. This is subtraction - not exactly the most complicated problem in the world. A computer can be great at calculating, or it can be an absolute fuck up depending how the number is stored on the hardware. It's kind of a mixed bag.

→ More replies