little formula to solve

BlitzMax Forums/BlitzMax Programming/little formula to solve

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Mine and Deps do work. Mine is slightly better since it would still work well with Ints.

Your example:

Percentage = ((Value - Range1) * 100) / (Range2 - Range1)
Percentage = (( 0 - -1 ) * 100) / ( 1 - -1 )
Percentage = (( 1 ) * 100) / ( 2 )
Percentage = 100 / 2
Percentage = 50