Jump to content
Banner by ~ Ice Princess Silky

The Banned Game


Twilight Sparkle ✨

Recommended Posts

Banned because most floating point variables store the exponent and mantissa, and most fixed point variables are actually integers with a hardcoded offset. storing the actual point really only happens with string variables :)

  • Brohoof 1
Link to comment
Share on other sites

Banned because computers store data in multiple different ways. They do this with binary, which you may have heard before or at least seen before. Binary is a counting system where instead of the decimals 0,1,2,3,4,5,6,7,8, and 9, numbers are encoded with the digits 0,1. One of these, a 0 or 1, is called a bit. Now that that's done, onto integers and floating point numbers. Integers are pretty much just a series of bits, like this 11001101. Now, the technicalities of how binary numbers even relate to normal numbers will take some time, but it relates to how in decimal numbers, each digit is a multiple of a power of 10. That is, the "ones" digit is a multiple of 10^0 which is 1, the "tens" digit is a multiple of 10^1 which is 10, the "hundreds" digit is a multiple of 10^2 which is 100, then 10^3, 10^4, and so on. For binary, it's powers of 2 instead of 10. So the digits would be 2^0=1,  2^1=2,  2^2=4,  2^3=8, 2^4=16, and so on. The value of an integer in binary works much the same way as decimals do. I could explain this a lot more clearly, but I don't want to make this too long. I'm sure there are many videos on YouTube that can help with that if you need. But next is floating point numbers. These ones are easy if you know about scientific notation, because essentially that's all they are. The exponent on the power of 10 is recorded as an integer, and the value its multiplied by can be recorded as a integer(ignoring the decimal point). If you don't know what scientific notation is, then I'll have to explain it. Scientific notation is, simply put, just a very easy way to record and do calculations with really large and really small numbers. It basically works by representing the number as some decimal multiplied by a power of ten. So for example, 1.23*10^2 would be 1.23*100=123. So 1.23*10^2=123. This can be used to record really big numbers by using large powers of 10 like 10^23 or 10^74. This allows for many calculations to become much easier because it reduces the problem to multiplying two decimals and adding two integers. So for example, multiplying 1.521*10^3 and 3.711*10^2 just becomes (1.521*3.711) * 10^(3+2) which is ~5.644*10^5. As for floating point numbers, they're stored this exact way, except with integers for both the significand(the part that's multiplied by power of 10) and the exponent. 

So, I just realized he also mentioned fixed point numbers, so I'm gonna briefly go over that. Basically, fixed point numbers are numbers where the power of 10 is fixed in place(hence the name "fixed point"). Meaning that no operation actually changes that. However, any operation which needs to change that value(in order to, say, record 1/3=0.33333...) is simply rounded off at the fixed point. Also, there's strings, which are just sets(or more technically, arrays) of characters represented as integers. Basically they're just sets of text like what you're reading now.

If you're confused about any of this, I recommend going to youtube and watching some videos on different data types. Their animations will probably be a lot easier to understand than my wall of text

Okay, that was alot. But now onto what CypherHoof said. What he was talking about was fixed point point numbers and floating point numbers. What he is saying about them is that in those types of variables, no decimal point is actually stored, only the significand and the exponent. The only variable that actually stores a decimal point is a string. The joke here is that the only data type which actually stores a decimal point is a string, which can literally store a "." in it. Now, to those who know a lot about this, I know I probably left out some things, or didn't go over certain topics that well. But in my defense, I could've done A LOT more than this if I were to fully explain this, but I decided to restrict myself to avoid making this too long.

  • Brohoof 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Join the herd!

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...