03-23-2004, 09:18 PM
Do a multiplication check in every multiplication done in the pow function.
M = M1 * M2 will overflow if M2 > 32767\M1
Generally:
A (operator) B will overflow if B > [max numer] (inv. operator) A.
Operator: +, Inv. operator: -
Operator: *, Inv. operator: /
Operator: pow, Inv. operator: nth root
...
M = M1 * M2 will overflow if M2 > 32767\M1
Generally:
A (operator) B will overflow if B > [max numer] (inv. operator) A.
Operator: +, Inv. operator: -
Operator: *, Inv. operator: /
Operator: pow, Inv. operator: nth root
...
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i