From a435094b4f673194b2d768194b1582f17a825c62 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Mon, 15 Jul 2024 11:29:07 +0700 Subject: [PATCH] Create computer.utils.js --- quantum_computer/computer.utils.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 quantum_computer/computer.utils.js diff --git a/quantum_computer/computer.utils.js b/quantum_computer/computer.utils.js new file mode 100644 index 0000000..39f49ac --- /dev/null +++ b/quantum_computer/computer.utils.js @@ -0,0 +1,7 @@ +export function clamp(value, min, max) { + return Math.min(Math.max(value, min), max); +} + +export function normalize(value, min, max) { + return (value - min) / (max - min); +}