/* Output: the smallest integer x such that 2^x > steps  */
static int sqsteps2shift(double steps_sq)
/* Output: the smallest integer x such that 2^x > steps  */
static int sqsteps2shift(double steps_sq)
{
    int r;
    frexp (MAX (1.0, steps_sq), &r);
    return (r + 1) >> 1;
}