Hab folgenden Code:
Delphi-Quelltext
1: 2:
| PositionInt:Word; Data.X:=Floor(ASingle /10)+(((LOBYTE(PositionInt)-$87)*3) shl 6); |
und ein Kumpel meinte, er bekommt da gelegendlich Exceptions
und hat das geändert zu:
Delphi-Quelltext
1: 2:
| PositionInt:Word; Data.X := Floor((LOBYTE(PositionInt) * 3 - $195) *64 + (ASingle / 10)); |
das sollte aber meiner meinung nach äquivalent sein, und wenn im ersten fall exceptions kommen, dann auch im 2.
nur sollte der obere code u.U. etwas schneller sein
ist das möglich?