```ts
/**
 * Returns the price before tax was added, rounded down.
 * @param gross - The gross price including tax.
 * @param rate - The tax rate as a whole number percentage.
 * @returns The price before tax, rounded down.
 */
export function vatBack(gross: number, rate: number): number {
  if (rate < 0) {
    throw new Error('Tax rate cannot be negative.');
  }
  return Math.floor(gross / (1 + rate / 100));
}
```