math-clamp-x

WebJar for math-clamp-x

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

math-clamp-x
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

math-clamp-x
WebJar for math-clamp-x
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Xotic750/math-clamp-x

Download math-clamp-x

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/math-clamp-x/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>math-clamp-x</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/math-clamp-x/
implementation 'org.webjars.npm:math-clamp-x:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/math-clamp-x/
implementation ("org.webjars.npm:math-clamp-x:1.2.0")
'org.webjars.npm:math-clamp-x:jar:1.2.0'
<dependency org="org.webjars.npm" name="math-clamp-x" rev="1.2.0">
  <artifact name="math-clamp-x" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='math-clamp-x', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "math-clamp-x" % "1.2.0"
[org.webjars.npm/math-clamp-x "1.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : to-number-x jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

math-clamp-x

Clamp a number to limits.

module.exports(value, [min], max)number

This method clamp a number to min and max limits inclusive.

Kind: Exported function
Returns: number - The clamped number.
Throws:

  • RangeError If min > max.
Param Type Default Description
value number The number to be clamped.
[min] number 0 The minimum number.
max number The maximum number.

Example

import mathClamp from 'math-clamp-x';

console.log(mathClamp(-5, 3, 3)); // 3
console.log(mathClamp(0, 3, 3)); // 3
console.log(mathClamp(5, 3, 3)); // 3

Versions

Version
1.2.0