A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sindresorhus/math-clamp below:

GitHub - sindresorhus/math-clamp: Clamp a number

math-clamp

Clamp a number

Install
npm install math-clamp
Usage
import mathClamp from 'math-clamp';

mathClamp(1, {min: 2, max: 4});
//=> 2

mathClamp(1, {min: 2});
//=> 2

mathClamp(5, {max: 4});
//=> 4

mathClamp(3n, {max: 2n});
//=> 2n
API mathClamp(number, {min?, max?}) Related

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4