Changes between Initial Version and Version 1 of Ticket #1842, comment 5


Ignore:
Timestamp:
May 23, 2019, 2:13:08 PM (6 years ago)
Author:
Bang Pham Huu

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1842, comment 5

    initial v1  
    33
    44{{{
    5  scaleRatio = (source.hi - source.lo + 1) / (dest.hi - dest.lo + 1)
    6  result = 0
    7  loop from 0 until 0 < source.hi:
    8      result += int(scaleRatio * index)
     5  scaleRatio = (source.hi - source.lo + 1) / (dest.hi - dest.lo + 1)
     6  realIndex = 0
     7  intIndex = 0
     8  loop from 0 until 0 < source.hi:
     9      realIndex += scaleRatio
     10      intIndex = int(realIndex)
    911}}}
    1012