[Solved] Fast Alpha Blending -percent based needed

Bare metal programming in PureBasic, for experienced users
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: [Solved] Fast Alpha Blending -percent based needed

Post by wilbert »

Michael Vogel wrote:yep, but I thought a floating point would slowing it down. More surprising is, why 'n*255/100' is faster than 'n*255 : n/100' and why the same formula is done quicker outside the procedure than inside?!
Floats aren't slow :)

And n = n*255/100 is faster as n = n*255 : n = n/100 because it's less work to do it at once compared to storing the result in between.
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply