-
Notifications
You must be signed in to change notification settings - Fork 2
constrain
Subhajit Sahu edited this page Aug 9, 2022
·
1 revision
Constrain a bigint within a minimum and a maximum value.
function constrain(x, minv, maxv)
// x: a bigint
// minv: minimum value
// maxv: maximum value
const xbigint = require('extra-bigint');
xbigint.constrain(20n, 0n, 50n);
// → 20n
xbigint.constrain(-10n, 0n, 100n);
// → 0n
xbigint.constrain(120n, 0n, 100n);
// → 100n
- constrain(): Processing reference
- clamp package by Hugh Kennedy
- std::clamp: cppreference
- std.algorithm.comparison.clamp: D-lang documentation
- clamp(): raster package by R documentation
- Math.Clamp: .NET docs
- clamp: Direct3D HLSL
- clamp: OpenGL Reference pages
- Mathf.Clamp: Unity documentation
- Clamping (graphics): Wikipedia