boolean data type

BlitzMax Forums/BlitzMax Programming/boolean data type

zambani(Posted 2008) [#1]
Is there ant difference in making true/false data a byte, short or an Int. I see a lots places where people use Int. Is that a waste of space since boolean can fit into a byte?

Thanks


Gabriel(Posted 2008) [#2]
Yes, it's a waste of space, but with even the cheapest machines having 2 gigs now, shaving off three bytes here and there really doesn't make much difference. Also, consider that using Integers is faster than Bytes and Shorts.


GfK(Posted 2008) [#3]
If you wanted to be really pedantic you could store eight booleans in a single byte.

Completely pointless, though.


zambani(Posted 2008) [#4]
@Gabriel: I had a feeling Int was faster

@Gfk: True, True