Is it bad for optimization? (real instead of integer)

imGuaimGua Member Posts: 1,089
edited January 2012 in Working with GS (Mac)
I have just realized, that in most field where I need to use integer, I'm using real. Is it bad for optimization, and if yes, then how bad it is?

Comments

  • JakeMorJakeMor Member, PRO Posts: 136
    TSB how dare you!
    Just like chocolate cake: EVERY byte matters!
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    @shmuley95=)) … made my day!

    @ImGus … the numerical attribute types set the form of the number when stored … therefore the type you chose allocates a bit/byte allotment for that attribute

    Index would need the least bits/bytes as it stores whole numbers; positive
    Real would need the most bits/bytes as it stores whole and/or decimal numbers; positive or negative
    Integer is in between in bits/bytes allotment as it stores whole numbers; positive or negative

    EX: if you only need whole positive numbers: use Index type
    if it is possible that your number could be fractional (decimal): use Real
    if it is possible that your whole number could be negative: use Integer

    any mathematical operation/function can be done on any number no matter what type you have assigned to the attribute.
    you can subtract a real number from an integer or index attribute … but, the computer will round-off the number when it stores/displays.

    @};- MH

    PS of course as TSB says: "but the difference is so small i don't think it will matter."
Sign In or Register to comment.