1. If you're looking for help-related things (for example, the key rebinding tutorial), please check the FAQ and Q&A forum! A lot of the stickies from this forum have been moved there to clean up space.
    Dismiss Notice

Threshold for Infinity

Discussion in 'Starbound Discussion' started by fafeman, Jul 11, 2014.

  1. fafeman

    fafeman Pangalactic Porcupine

    x
     
    Last edited: May 16, 2017
  2. Avstah

    Avstah Void-Bound Voyager

    Wat?
     
    Yzzey, BitHorizon and Serenity like this.
  3. linkthegamer

    linkthegamer Master Astronaut

    I call haxs.

    Neat tut though~.

    Guide how to hack a LOT of items supped up stats into the game without making it crash basically if I read right.
     
    Serenity likes this.
  4. Lemuria

    Lemuria Subatomic Cosmonaut

    "Infinity"? >.>

    Floran recommendss tasty people ssimply read up on ssigned and unsigned numberss.
     
  5. MysticMalevolence

    MysticMalevolence Oxygen Tank

    Nice. I'm surprised scientific notation works, but then again I know nothing of coding/modding.
    As a side note though, infinity isn't nessesarily a large number. Infinity, because it is infinite, represents both large and small numbers.
     
    linkthegamer likes this.
  6. prodamn

    prodamn Spaceman Spiff

    TO INFINITY AND BEYOND!!! xD

    jokes aside, cool finding! i was wondering about the same a while ago. :up:
    But i was way too lazy to figure that out.. but you did, Good Joob, sir!
     
  7. Ashen

    Ashen Scruffy Nerf-Herder

    You can also have multiple infinities. For example, take 1 to infinity and then take all the odd numbers out to make a new infinity of just the odd numbers. So now you have 1, 3, 5, to infinity and 2, 4, 6 to infinity. Thus creating two separate infinities. This can also be done with prime numbers, factors, composites, and even products.
     
  8. prodamn

    prodamn Spaceman Spiff

    what ?
     
    Serenity likes this.
  9. Ashen

    Ashen Scruffy Nerf-Herder

    Sorry if it was not too clear. I was just elaborating more on how insane working with infinity is...
     
    prodamn likes this.
  10. MysticMalevolence

    MysticMalevolence Oxygen Tank

    Infinity is everything.
     
  11. cooltv27

    cooltv27 Heliosphere

    another example is the amount of numbers between 0 and 1
    0.001 0.00000005 0.00007 and the rest
     
  12. @prodamn please make sure you're contributing to the discussion
     
  13. prodamn

    prodamn Spaceman Spiff

    okay..
     
    Nutric and khalismur like this.
  14. I don't think you really understand the reasoning behind why such a limitations exist.

    32 bits is ultimately a hardware limitation - if a processor is 32 bits that is the maximum number of bits it can process in one operation. This has a number of other effects (such as lower memory capability due to only being able to access enough memory addresses for ~3GB, (a barrier which can be overcome using other methods but I digress). To my knowledge, all that is meant by a 32-bit or 64-bit program is optimised for use on that particular hardware architecture.

    Secondly, the number doesn't become 'infinity' (it's not even a number, it's merely an abstract concept meaning "without bounds") - infinity isn't even a notion to a computer - you can't store something infinite in a finite space. Any limitation on the size of a number is because of the amount of memory assigned to store it in. This comes down to a compiler or language limitation and would be specified in the language documentation. Typically in any modern language, an integer would be allocated 32 bits and a floating point 32 (some languages default to using a 64 bit 'double' to store decimal numbers to avoid floating point precision errors), though it's highly likely there would also exist more compact or lengthy type (such as a long integer). For example, it is possible to use a 64-bit long integer on a 32-bit system, it is just inefficient since it will need to be read over multiple operations by the CPU.

    Operations which exceed the maximum/minimum number that can be stored in the allocated memory leads to arithmetic overflow which results in getting a number which has no correlation to the result of your operation (the number you get comes about due to what happens on a bitwise level). Chances are there is some kind of error handling in place for this, likely defaulting the value to zero or the maximum allowable.

    As for why scientific notation works - who knows? If I had to guess, I'd say that if the number is not a decimal number (i.e you just typed '9' over and over again), it defaults to storing it as an integer (whatever is reading through this file might determine the type of each string token as it goes), but using scientific notation the program has to store it as a floating point number of some kind (and floating point data types can store much larger numbers due to how the number is stored).

    Don't ask why but I felt the need to clear that up.
     
  15. Program_024

    Program_024 Title Not Found

    If memory serves me correct, Floating point numbers are stored much differently than integers.

    A signed 32 bit integer will have up to 32 bits worth of digits. That value is 2^31 or something like that due to the sign. The sign of the number tells you whether the integer is positive or negative. Once that leading bit gets flipped to a 1, the number becomes negative. That is probably why the game crashes. The engine doesn't like negative numbers for a system that probably always assumes positive values.

    Unsigned integers don't use the leading bit to indicate a positive or negative integer. So the maximum value is 2^32, which is a very large number.

    Floating point numbers are stored differently than integers. For a 32 bit system, you have 32 bits for a given number that is expressed using the scientific notation as mentioned earlier. Instead of using all 32 bits as a single number like in integers, the block of memory is broken up. You have some 8 bits to express the exponent of the float. 8 bits will give you 2^8 as a maximum value. One bit is used for the sign, to indicate positive or negative, and the rest is used for the actual number string. This allows for numbers much larger than the 32 bit integer or unsigned integer. As a by product, it also allows for greater precision. Integers are not very precise
     
    fafeman likes this.
  16. Fiben Bolger

    Fiben Bolger Pangalactic Porcupine

    Did you just reprimand him for making general comments in General Discussion?
     
    fafeman, Nutric, naphid and 1 other person like this.
  17. no
     
    Nutric and Serenity like this.
  18. BitHorizon

    BitHorizon Ketchup Robot

    Wow, according to wolfram alpha, that's 99000000000000000000000000000000000000...
    You would never need to worry about damage.
     
  19. Serenity

    Serenity The Waste of Time

    so it's over 9000!
     
    Nutric and MysticMalevolence like this.
  20. Lora Grim

    Lora Grim Guest

    Noooo! Not the math! I am horrible at it!

    *dying noises* My... one weakness.... ahhgh. *ded*
     

Share This Page