[Gambas-user] Possible error when doing math on bytes

Jussi Lahtinen jussi.lahtinen at gmail.com
Tue Jan 3 23:34:14 CET 2023


It is a feature, but it is also documented.
Bytes can have values only between 0 - 255.


Jussi



On Wed, Jan 4, 2023 at 12:30 AM Brian G <brian at westwoodsvcs.com> wrote:

> When I do math on bytes I get an overflow now when  the value of the byte
> goes negative
> example:
>  dim a as byte = 0
>  dim b as byte = 24
>  dim result as byte = a - b
>
> This causes an overflow error, where in the past it was just a negative
> number.
> Is this a bug or a new undocumented feature?
>
>
> "Failure is the key to success;
>  each mistake teaches us something"  .. Morihei Ueshiba
> Brian G
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230104/a80de1f0/attachment.htm>


More information about the User mailing list