Sets a range of bits.

@throws InvalidArgumentException if end is smaller than start
762137
public function setRange(int $start, int $end) : void
    {
        if ($end < $start) {
            throw new InvalidArgumentException('End must be greater or equal to start');
        }

        if ($end === $start) {
            return;
        }

        --$end;

        $firstInt = $start >> 5;
        $lastInt = $end >> 5;

        for ($i = $firstInt; $i <= $lastInt; ++$i) {
            $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
            $lastBit = $i < $lastInt ? 31 : $end & 0x1f;

            if (0 === $firstBit && 31 === $lastBit) {
                $mask = 0x7fffffff;
            } else {
                $mask = 0;

                for ($j = $firstBit; $j < $lastBit; ++$j) {
                    $mask |= 1 << $j;
                }
            }

            $this->bits[$i] = $this->bits[$i] | $mask;
        }
    }
1128987
public function setPrecision($bits)
    {
        $this->precision = $bits;
        if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_BCMATH) {
            $this->bitmask = new BigInteger(chr((1 << ($bits & 0x7)) - 1) . str_repeat(chr(0xFF), $bits >> 3), 256);
        } else {
            $this->bitmask = new BigInteger(bcpow('2', $bits, 0));
        }

        $temp = $this->protectedNormalize($this);
        $this->value = $temp->value;
    }
806363
void setBits(BitSet table) {
    for (int c = Character.MAX_VALUE; c >= Character.MIN_VALUE; c--) {
      if (matches((char) c)) {
        table.set(c);
      }
    }
  }
510371
public Bits writeBoundedLong(final long value, final long max)
    throws IOException {
    final int bits = 0 >= max ? 0 : (int) (Math
      .floor(Math.log(max) / Math.log(2)) + 1);
    if (0 < bits) {
      Bits toWrite = new Bits(value, bits);
      this.write(toWrite);
      return toWrite;
    }
    else {
      return Bits.NULL;
    }
  }
410919
public static void setLong(long n, byte[] b, int off, boolean littleEndian) {
		if (littleEndian) {
			setInt((int) n, b, off, LITTLE_ENDIAN);
			setInt((int) (n >>> 32), b, off + 4, LITTLE_ENDIAN);
		} else {
			setInt((int) (n >>> 32), b, off, BIG_ENDIAN);
			setInt((int) n, b, off + 4, BIG_ENDIAN);
		}
	}
1327981
public static void resetBitmapRange(long[] bitmap, int start, int end) {
    if (start == end) {
      return;
    }
    int firstword = start / 64;
    int endword = (end - 1) / 64;

    if (firstword == endword) {
      bitmap[firstword] &= ~((~0L << start) & (~0L >>> -end));
      return;
    }
    bitmap[firstword] &= ~(~0L << start);
    for (int i = firstword + 1; i < endword; i++) {
      bitmap[i] = 0;
    }
    bitmap[endword] &= ~(~0L >>> -end);

  }
1283776
public void not() {
        IntBitSet tmp;

        tmp = new IntBitSet();
        tmp.addRange(0, used - 1);
        tmp.removeAll(ends);
        ends = tmp;
    }
1167245
public void setRange(double A, double B)
    {
        if(A == B)
            throw new RuntimeException("Values must be different");
        else if(B > A)
        {
            double tmp = A;
            A = B;
            B = tmp;
        }
        this.A = A;
        this.B = B;
    }
224593
final public void setOffset(Integer start, Integer end) {
    if ((start == null) || (end == null)) {
      // do nothing
    } else if (start > end) {
      throw new IllegalArgumentException("Start offset after end offset");
    } else {
      tokenOffset = new MtasOffset(start, end);
    }
  }
628314
private function doSetBinaryBitsetLeBin($bitset): void
    {
        $size   = \strlen($this->bitset);
        $sizeIn = \strlen($bitset);

        if ($sizeIn < $size) {
            // add "\0" if the given bitset is not long enough
            $bitset .= \str_repeat("\0", $size - $sizeIn);
        } elseif ($sizeIn > $size) {
            if (\ltrim(\substr($bitset, $size), "\0") !== '') {
                throw new InvalidArgumentException('out-of-range bits detected');
            }
            $bitset = \substr($bitset, 0, $size);
        }

        // truncate out-of-range bits of last byte
        $lastByteMaxOrd = $this->enumerationCount % 8;
        if ($lastByteMaxOrd !== 0) {
            $lastByte         = $bitset[-1];
            $lastByteExpected = \chr((1 << $lastByteMaxOrd) - 1) & $lastByte;
            if ($lastByte !== $lastByteExpected) {
                throw new InvalidArgumentException('out-of-range bits detected');
            }

            $this->bitset = \substr($bitset, 0, -1) . $lastByteExpected;
        }

        $this->bitset = $bitset;
    }
140734
public void set(long startIndex, long endIndex)
    {
        if (endIndex <= startIndex) return;

        int startWord = (int) (startIndex >> 6);

        // since endIndex is one past the end, this is index of the last
        // word to be changed.
        int endWord = expandingWordNum(endIndex - 1);

        long startmask = -1L << startIndex;
        long endmask = -1L >>> -endIndex; // 64-(endIndex&0x3f) is the same as -endIndex
                                          // due to wrap

        if (startWord == endWord)
        {
            bits[startWord] |= (startmask & endmask);
            return;
        }

        bits[startWord] |= startmask;
        Arrays.fill(bits, startWord + 1, endWord, -1L);
        bits[endWord] |= endmask;
    }
967007
public void setRange( int dimension , double min , double max ) {
		valueMin[dimension] = min;
		valueMax[dimension] = max;
	}
493928
protected void addRange(int start, int end) {
		this.icaseCache = null;
		// System.err.println("Token#addRange(): "+start+" "+end);
		int r1, r2;
		if (start <= end) {
			r1 = start;
			r2 = end;
		} else {
			r1 = end;
			r2 = start;
		}

		int pos = 0;
		if (this.ranges == null) {
			this.ranges = new int[2];
			this.ranges[0] = r1;
			this.ranges[1] = r2;
			this.setSorted(true);
		} else {
			pos = this.ranges.length;
			if (this.ranges[pos - 1] + 1 == r1) {
				this.ranges[pos - 1] = r2;
				return;
			}
			int[] temp = new int[pos + 2];
			System.arraycopy(this.ranges, 0, temp, 0, pos);
			this.ranges = temp;
			if (this.ranges[pos - 1] >= r1)
				this.setSorted(false);
			this.ranges[pos++] = r1;
			this.ranges[pos] = r2;
			if (!this.sorted)
				this.sortRanges();
		}
	}
579589
public function setRange($min, $max)
	{
		$min = filter_var($min, FILTER_VALIDATE_INT);
		$max = filter_var($max, FILTER_VALIDATE_INT);

		if ($min === false)
		{
			throw new InvalidArgumentException('Argument 1 passed to ' . __METHOD__ . ' must be an integer');
		}

		if ($max === false)
		{
			throw new InvalidArgumentException('Argument 2 passed to ' . __METHOD__ . ' must be an integer');
		}

		if ($min > $max)
		{
			throw new InvalidArgumentException('Invalid range: min (' . $min . ') > max (' . $max . ')');
		}

		$this->vars['min'] = $min;
		$this->vars['max'] = $max;
	}
77193
public static function range(float $start, float $end, float $interval = 1.) : self
    {
        if ($interval <= 0.) {
            throw new InvalidArgumentException('Interval must be greater'
                 . " than 0, $interval given.");
        }

        return static::quick(range($start, $end, $interval));
    }
1067185
def set(self, addr, values):
        
        addr -= self._start_addr
        end = addr + len(values)
        if not 0 <= addr <= end <= len(self._data):
            addr += self._start_addr
            raise IndexError("Invalid address range [{:#06x} - {:#06x}]"
                             .format(addr, addr + len(values)))
        self._data[addr:end] = values
45627
public function setEnd($position)
    {
        if (! is_int($position)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be of type integer. Argument type is ' . gettype($position));
        }

        $this->end = $position;
    }