Also complex math included.
Some calculator input expression exampes:
Full list of input syntax resources:
# ---------- # Base Units # ---------- base_units = ['kg', 'm', 's', 'A', 'K', 'mol', 'cd', 'rad', 'sr', '%', 'dB', 'bit'] # --------- # Constants # --------- # pi, e, j # --------- # Functions # --------- # abs, int, sqrt, ln, log, sin, asin, cos, acos, tan, atan, frac # ------------- # Special Units # ------------- # percent, % = pc def to_pc(x): "to_pc(50/100)=50*%, (50*pc)/pc=50, anything+50*pc=1.5*anything" return 100*x*pc # dB def to_dB(x): "to_dB(2)=~3*dB, (3*dB)/dB=~2, (3*dB).dB=3, anything+3*dB=~2*anything" return 10*log(x)*dB # dBm and dBW, unit of power (W) dBm = quantity('dBm', [0]*len(base_units)) dBW = quantity('dBW', [0]*len(base_units)) # Celsius degC = quantity('degC', [0]*len(base_units)) # absolute temperature dC = K # relative temperature, for summing and subtraction # Example: 20*degC+10*dC = 303.15*K, while 20*degC+10*degC = 576.3*K # Fahrenheit degF = quantity('degF', [0]*len(base_units)) # absolute temperature dF = 5*K/9 # relative temperature, for summing and subtraction # Quantities may be given in any unit with Quantity.unit('any_unit') # Example: (55*mph).unit('km/h') = '88.51391999999997*km/h' # -------- # Prefixes # -------- Y_ = 1e24 Z_ = 1e21 E_ = 1e18 P_ = 1e15 T_ = 1e12 G_ = 1000000000 M_ = 1000000 k_ = 1000 h_ = 100 da_ = 10 d_ = 0.1 c_ = 0.01 m_ = 1e-3 u_ = 1e-6 n_ = 1e-9 p_ = 1e-12 f_ = 1e-15 a_ = 1e-18 z_ = 1e-21 y_ = 1e-24 # Binary Prefixes Ki_ = 2**10 Mi_ = 2**20 Gi_ = 2**30 Ti_ = 2**40 Pi_ = 2**50 Ei_ = 2**60 # ------------- # Derived Units # ------------- # Dimensionless pm = m_*100*pc # permille ppm = u_*100*pc # parts per million ppb = n_*100*pc # parts per billion ppt = p_*100*pc # parts per trillion Np = 20*log10(e)*dB # Neper mrad = m_*rad rev = 2*pi*rad # revolution deg = pi/180*rad amin = deg/60 # arcminute asec = amin/60 # arcsecond # radians.dms returns in revs, degrees, arcmins and arcsecs. Example: # (10*rad).dms = 1*rev + 212*deg + 57*amin + 28.0624709636525*asec B = 2**3*bit # Byte Kibit = Ki_*bit MiB = Mi_*B GiB = Gi_*B # Mass g = kg/k_ mg = m_*g ug = u_*g Mg = M_*g t = Mg # metric ton lb = 0.45359237*kg # Pound, avoirdupois (exact) oz = lb/16 # Ounce st = 14*lb # Stone # Length fm = f_*m pm = p_*m nm = n_*m um = u_*m mm = m_*m cm = c_*m dm = d_*m km = k_*m Mm = M_*m nmi = 10*Mm/(60*90) # Nautical Mile Å = 1e-10*m in_ = 25.4*mm mil = m_*in_ ft = 12*in_ yd = 3*ft mi = 1760*yd # Area b = 100*fm**2 # Barn ha = (h_*m)**2 # Hectare ac = 66*ft*660*ft # Acre # Volume L = dm**3 uL = u_*L mL = m_*L cL = c_*L dL = d_*L cc = cm**3 tbsp = 15*mL # Tablespoon tsp = tbsp/3 # Teaspoon galUS = 231*in_**3 # US gallon ptUS = galUS/8 # US pint flozUS = ptUS/16 # US fluid ounce cupUS = ptUS/2 # US cup cupLUS = 240*mL # US legal cup tbspUS = flozUS/2 # US tablespoon tspUS = tbspUS/3 # US teaspoon galI = 4.54609*L # Imperial gallon (exact) ptI = galI/8 # Imperial pint flozI = ptI/20 # Imperial fluid ounce tbspI = flozI*5/8 # Imperial tablespoon tspI = tbspI/3 # Imperial teaspoon tbspAu = 20*mL # Australia tablespoon tbspCa = flozI/2 # Canada tablespoon tspCa = tbspCa/3 # Canada teaspoon # Time ps = p_*s ns = n_*s us = u_*s ms = m_*s mn = 60*s # minute h = 60*mn dy = 24*h wk = 7*dy yrJ = 365.25*dy # Julian year yrG = 365.2425*dy # Gregorian year monthJ = yrJ/12 # Average month in Julian year # seconds.hms returns weeks, days, hours and seconds. Example: # (1e6*s).hms = 1*wk + 4*dy + 13*h + 46*mn + 40.0*s # HH:MM returns HH*h + MM*mn # Speed kt = nmi/h # knot knot = kt kph = km/h mph = mi/h # miles per hour # Inv Time Bq = 1/s Hz = 1/s mHz = m_*Hz kHz = k_*Hz MHz = M_*Hz GHz = G_*Hz rpm = 1/mn # revolutions per minute kc = kHz mc = MHz # Force N = kg*m/s**2 uN = u_*N mN = m_*N kN = k_*K MN = M_*N # Power W = N*m/s mW = m_*W kW = k_*W MW = M_*W # Energy J = N*m kJ = k_*J MJ = M_*J Ws = W*s kWh = kW*h # Radiation Dose Gy = J/kg Sv = J/kg # Pressure Pa = N/m**2 hPa = h_*Pa kPa = k_*Pa MPa = M_*Pa bar = 100*kPa mbar = m_*bar # Electric Current uA = u_*A mA = m_*A kA = k_*A # Charge As = A*s C = As mC = m_*C kC = k_*C mAh = m_*A*h # Voltage V = J/C uV = u_*V mV = m_*V kV = k_*V MV = M_*V # Resistance ohm = V/A kohm = k_*ohm Mohm = M_*ohm # Conductance S = 1/ohm # Capacitance F = C/V mF = m_*F uF = u_*F nF = n_*F pF = p_*F # Magnetic Flux Wb = V*s # Inductance H = Wb/A mH = m_*H uH = u_*H nH = n_*H # Magnetic Flux Density (B) T = Wb/m**2 # Magnetic Field Intensity (H) Oe = 1000/(4*pi)*A/m # Catalytic Activity katal = mol/s # Luminous Flux lm = cd*sr # Illuminance lx = lm/m**2 # -------------------------------- # Physical constants and standards # -------------------------------- G = 6.6743e-11*m**3*kg**-1*s**-2 # Universal Gravitational Constant g0 = 9.80665*m/s**2 # Standard Gravity (exact) atm = 101325*Pa # Standard Atmosphere (exact) c0 = 299792458*m/s # Speed of Light (exact) hP = 6.62607015e-34*J*s # Planck Constant (exact) _hP = hP/(2*pi) # Reduced Planck Constant u0 = 1.25663706212e-6*H/m # Vacuum Permeability e0 = 1/(u0*c0**2) # Electric Constant qe = 1.602176634e-19*A*s # Elementary Charge (exact) me = 9.10938356e-31*kg # Electron Mass mp = 1.672621898e-27*kg # Proton Mass u = 1.6605390666e-27*kg # Atomic Mass unit kB = 1.380649e-23*J/K # Boltzmanns Constant (exact) sc = pi**2*kB**4/(60*_hP**3*c0**2) # Stefan-Boltzmann Constant (sigma) NA = 6.02214076e23/mol # Avogadro Constant (exact) Rg = NA*kB # Gas Constant Fc = qe*NA # Faraday Constant # --------------------------------- # Derived Units II, # (dependent on physical constants) # --------------------------------- # Length ly = yrJ*c0 # Light-year # Force kgf = kg*g0 # Kilogram-force lbf = lb*g0 # Pound-force # Power hpI = 33000*ft*lbf/mn # Mechanical (Imperial) horsepower hpM = 75*g0*kg*m/s # Metric horsepower hpE = 746*W # Electric horsepower # Energy eV = qe*V # Electronvolt meV = m_*eV keV = k_*eV MeV = M_*eV cal = 4.184*J # Thermochemical Calorie (exact), # (water spec heat capacity ~4.184 J/(g*K) ) kcal = k_*cal cal_IT = 4.1868*J # Steam Table Calorie (exact) BTU_Th = cal*dF/K*lb/g # British Thermal Unit (Thermochemical variant) BTU = cal_IT*dF/K*lb/g # British Thermal Unit (Steam Table variant) BTU_ISO = round(BTU, 2) # British Thermal Unit (ISO 31-4 variant) # Pressure at = kgf/cm**2 # Technical atmosphere Torr = atm/760 mmHg = 133.322387415*Pa # (defined exact) psi = lbf/in_**2 # Pound-force per square inch
2024-11-21 07:47:01 CET
CPU temp = 24 °C