text: import { NotImplementedError } from '../extensions/index.js';
  
  const MODERN_ACTIVITY = 15;
  const HALF_LIFE_PERIOD = 5730;
  
  /**
   * Determine the age of archeological find by using
   * given MODERN_ACTIVITY and HALF_LIFE_PERIOD values
   *
   * @param {String} sampleActivity string representation of current activity
   * @return {Number | Boolean} calculated age in years or false
   * in case of incorrect sampleActivity
   *
   * @example
   *
   * dateSample('1') => 22387
   * dateSample('WOOT!') => false
   *
   */
  export default function dateSample(sampleActivity) {
    if (!sampleActivity || typeof sampleActivity !== 'string') {
      return false;
    }
  
    const sampleActivityInt = parseFloat(sampleActivity);
  
    if (isNaN(sampleActivityInt) || sampleActivityInt > MODERN_ACTIVITY || sampleActivityInt <= 0) {
      return false;
    }
  
    // Count of half life periods of this activity
    const half_life_periods = Math.log2(MODERN_ACTIVITY / sampleActivityInt);
    return Math.ceil(HALF_LIFE_PERIOD * half_life_periods);
  }
  