3 ms·
Temperature is weird. every other measurement scale starts at 0 but nether C nor F does. you have to use kelvin or rankine for that. This throws a big wrench in
by somat 3y ago
Temperature is weird. every other measurement scale starts at 0 but nether C nor F does. you have to use kelvin or rankine for that. This throws a big wrench into the calculation engine as now it has to support offsets for this one single use case. In fact openbsd units still does not support the C to F calculation.
- PaulDavisThe1st 3y agoIt's even more weird than that. units(1) can compute "starting at T Celsius, if i add N degrees celsius, how many degrees Fahrenheit did I add? and defaults to this for naive attempts to convert between the two, AND "what is X Fahrenheit in Celsius?" That is, it can convert between delta-C and delta-F, and also between absolute C and F.
- kragen 3y agothis one single use case ?! $ units Currency exchange rates from FloatRates (USD base) on 2023-08-03 3539 units, 109 prefixes, 111 nonlinear units You have: dBm(0) You want: Definition: 0.001 kg m^2 / s^3 You have: pH(0) You want: Definition: 1000 mol / m^3 You have: gasmark(0) Argument of function outside domain You have: gasmark(0.25) You want: Definition: 380.37222 K You have: gasmark(0.5) You want: Definition: 394.26111 K You have: gasmark(0.75) You want: Definition: 401.20556 K You have: gasmark(1) You want: Definition: 408.15 K You have: gasmark(1.25) You want: Definition: 411.62222 K You have: shoesize_men(0) You want: Definition: 0.20955 m You have: shoesize_men Definition: shoesize_men(n) = shoe_men0 + n shoesize_delta n is dimensionless You have: bril(0) You want: Definition: 2.5110222e-27 cd / m^2 You have: airmass Definition: airmass(alt) = 1 / (sin(alt) + 0.50572 (alt / degree + 6.07995)^-1.6364) defined for 0 degree <= alt <= 90 degree You have: airmass(0 degrees) You want: Definition: 37.919608 You have: atm_transmissionz Definition: atm_transmissionz(zenith) = exp(-extinction_coeff airmassz(zenith)) defined for 0 degree <= zenith <= 90 degree You have: atm_transmissionz(34 degree) You want: Definition: 0.77637004 You have: atm_transmissionz(0 degree) You want: Definition: 0.81063327 You have: vmag(-1.46) # Sirius You want: Definition: 9.746164e-06 cd sr / m^2 You have: vmag(0) # Vega You want: Definition: 2.54e-06 cd sr / m^2 You have: baume(0) You want: Definition: 1000 kg / m^3 You have: search gauge brwiregauge <piecewise linear> drillgauge <piecewise linear> gaugepressure <nonlinear> plategauge <piecewise linear> screwgauge <nonlinear> standardgauge 4 ft + 8.5 in stdgauge <piecewise linear> wiregauge <nonlinear> zincgauge <piecewise linear> You have: plategauge(0) You want: Definition: 0.0079375 m You have: wiregauge(0) You want: Definition: 0.0082514628 m You have: sugar_bp(tempF(250)) # candy boiling point You want: Definition: 1475.0252 kg / m^3 You have: degF(30) You want: sugar_conc_bpe # computed via this 86.975291 You have: sugar_conc_bpe Definition: interpolated table with points sugar_conc_bpe(0) = 0 K sugar_conc_bpe(5) = 0.0788 K sugar_conc_bpe(10) = 0.169 K sugar_conc_bpe(15) = 0.2729 K ... sugar_conc_bpe(99.6) = 70.1448 K sugar_conc_bpe(99.7) = 76.7867 K You have: apidegree(0) # petroleum degree You want: Definition: 1076.0456 kg / m You have: ipv4subnetsize(24) You want: Definition: 256 You have: ipv4subnetsize(26) You want: Definition: 64 You have: gaugepressure(0 psi) You want: psi * 14.695949 / 0.068045964 nonlinear and even non-affine measurement units are everywhere man