/* eslint-disable no-restricted-properties */ import * as Unit from "./unit"; ///////////////// /// SI PREFIXES // ///////////////// export function Giga(name: string, u: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, 9), u); } export function Mega(name: string, u: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, 6), u); } /** * Returns the specified unit multiplied by the factor 103 * @param unit Any unit. * @returns unit.multiply(1e3) . */ export function Kilo(name: string, unit: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10.0, 3), unit); } /** * Returns the specified unit multiplied by the factor 102. * @param unit any unit. * @returns unit.multiply(1e2) . */ export function Hecto(name: string, unit: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, 2), unit); } /** * Returns the specified unit multiplied by the factor 10-1. * @param unit any unit. * @return unit.multiply(1e-1). */ export function Deci(name: string, unit: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, -1), unit); } /** * Returns the specified unit multiplied by the factor 10-2. * @param unit any unit. * @returns unit.multiply(1e-2) . */ export function Centi(name: string, unit: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, -2), unit); } /** * Returns the specified unit multiplied by the factor 10-3. * @param unit any unit. @return unit.multiply(1e-3) . */ export function Milli(name: string, unit: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, -3), unit); } /** * Returns the specified unit multiplied by the factor 10-6. * @param unit any unit. @return unit.multiply(1e-6) . */ export function Micro(name: string, unit: Unit.Unit): Unit.Unit { return Unit.timesNumber(name, Math.pow(10, -6), unit); } // export function Si(toAdd: Unit.Unit): Unit.Unit { // // TODO // return toAdd; // }