Files
_hublib-web/dist/react/video-player/shared/math.js

18 lines
466 B
JavaScript
Raw Normal View History

2026-02-27 09:50:13 +03:00
export const gcd = (a, b) => {
return b === 0 ? a : gcd(b, a % b);
};
export const numWord = (value, words) => {
const normalized = Math.abs(value) % 100;
const remainder = normalized % 10;
if (normalized > 10 && normalized < 20) {
return words[2];
}
if (remainder > 1 && remainder < 5) {
return words[1];
}
if (remainder === 1) {
return words[0];
}
return words[2];
};
//# sourceMappingURL=math.js.map