@vivliostyle/core
    Preparing search index...

    Function binarySearch

    • Function good is defined for ints from 0 to high-1. It is such that for each i between 1 and high-1 !good(i-1) || good(i) is true. In other words, it goes like false ... false true ... true. Find i such that (i == 0 || !good(i-1)) && (i == h || good(i)) In other words, good(i) is the "first" good = true.

      Parameters

      • high: number
      • good: (p1: number) => boolean

      Returns number