Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

RATIO_PACKAGE

const RATIO_PACKAGE: IEnginePackage;

Defined in: packages/engine/src/packages/ratio/RatioPackage.ts:15

Reduce a ratio to its lowest whole-number terms (issue #252): ratio(1920, 1080) is 16:9, ratio(2, 4, 6) is 1:2:3. On by default and removable.

It is a function, ratio(...), rather than a 1920:1080 literal, because a colon already builds a range (1:10). Reduction is by the greatest common divisor. Parts must be whole positive numbers, and there must be at least two; anything else is answered with a structured Error.