Conversation
Composing scale factors from unit properties (e.g., gram.scale / centimeter.scale ** 3) can introduce floating-point artifacts. roundScale rounds to 15 significant digits to eliminate these while preserving all meaningful precision. Exported from the package root for use at call sites where composition noise is visible.
Adds unit modules for density, specificVolume, momentum, angularVelocity, angularAcceleration, torque, dynamicViscosity, kinematicViscosity, surfaceTension, wavenumber, heatCapacity, specificHeatCapacity, specificEnergy, thermalConductivity, electricFieldStrength, permittivity, permeability, currentDensity, volumetricFlowRate, massFlowRate, concentration, and molarMass. Also adds non-trivial units to existing modules: kilometerPerHour (velocity), ampereHour/milliampereHour (charge), atmosphere (pressure), squareKilometer/squareCentimeter (area). Closes #11
Add ' — the type system cannot distinguish them' to the shared-dimension notes in frequency.ts and absorbed-dose.ts, matching the phrasing used in the new angular-velocity, torque, and specific-energy modules.
26 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds SI unit modules for the quantities introduced in #10, plus non-trivial units for several existing modules. Each new quantity gets a module with its base SI unit, and quantities with common non-SI-prefix conversions include those as well (e.g., gramPerLiter, revolutionPerMinute, literPerMinute).
New unit modules:
Additional units for existing modules:
Composing scale factors from unit properties can introduce IEEE 754 noise (e.g.,
centimeter.scale ** 3producing1.0000000000000002e-6instead of1e-6). A newroundScaleutility in dim-unit rounds computed factors to 15 significant digits, eliminating these artifacts while preserving all meaningful precision. It's an opt-in call-site tool —scaled()itself is unchanged.Also aligns the shared-dimension note phrasing in frequency.ts and absorbed-dose.ts to match the new modules.
Closes #11.