mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-30 00:11:54 +02:00
14 lines
362 B
JavaScript
14 lines
362 B
JavaScript
/* MAIN */
|
|
const Lang = {
|
|
/* API */
|
|
clamp: (number, lower, upper) => {
|
|
if (lower > upper)
|
|
return Math.min(lower, Math.max(upper, number));
|
|
return Math.min(upper, Math.max(lower, number));
|
|
},
|
|
round: (number) => {
|
|
return Math.round(number * 10000000000) / 10000000000;
|
|
}
|
|
};
|
|
/* EXPORT */
|
|
export default Lang;
|