06-07-2025, 02:46 AM
(This post was last modified: 06-07-2025, 02:49 AM by hsiangch_ong.)
popu% needs to be popu&
or maybe even popu&&
remember that in qb64 integer values can wrap around. not like basica which could report overflow.
in case of zero or negative, if the value must be positive, you should be checking for its value and restrict it. sadly this means popu variable should be at least a LONG instead of INTEGER. because making it _UNSIGNED INTEGER would cause it to wrap back up to 65535. when one expects it to become negative below zero.
or maybe even popu&&
remember that in qb64 integer values can wrap around. not like basica which could report overflow.
in case of zero or negative, if the value must be positive, you should be checking for its value and restrict it. sadly this means popu variable should be at least a LONG instead of INTEGER. because making it _UNSIGNED INTEGER would cause it to wrap back up to 65535. when one expects it to become negative below zero.

