> For the complete documentation index, see [llms.txt](https://sewlore.gitbook.io/sewlore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sewlore.gitbook.io/sewlore-docs/units-precision-and-numeric-domains.md).

# Units, Precision and Numeric Domains

Every comparison call expects one common length unit. Convert readings together and retain the converted values for calculation. An inch comparison with target 4, width 3.99 and height 4.01 becomes 10.16, 10.1346 and 10.1854 centimetres. Rounding first changes the available information.

JavaScript convertLength accepts only cm and in. It allows finite signed offsets and zero; it does not validate positive measurements. Passing mm is rejected. Conversely, calculatePrintScale and calculateStretch require numeric, finite, positive readings. A string such as "8" is rejected.

Undefined differs from zero. With original, stretched and released lengths all 8, stretch is 0%, but recoveredExtensionPercent is null: there was no extension to divide by. With readings 8, 10 and 10.2, recovery is −10% and unusualReleasedLength is true. Preserve the result for rechecking instead of clamping it.

| Reading  | Inches | Centimetres retained |
| -------- | ------ | -------------------- |
| Target   | 4      | 10.16                |
| Width X  | 3.99   | 10.1346              |
| Height Y | 4.01   | 10.1854              |

[Read the implemented input requirements](https://github.com/gokimedia/sewlore-sewing-tools/blob/main/docs/api.md)
