MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / verifuint

Function verifuint

MathBox/mathbox-core.js:2018–2023  ·  view source on GitHub ↗
(value, max)

Source from the content-addressed store, hash-verified

2016 * exceed the maximum allowed value.
2017 */
2018function verifuint (value, max) {
2019 assert(typeof value === 'number', 'cannot write a non-number as a number')
2020 assert(value >= 0, 'specified a negative value for writing an unsigned value')
2021 assert(value <= max, 'value is larger than maximum value for type')
2022 assert(Math.floor(value) === value, 'value has a fractional component')
2023}
2024
2025function verifsint (value, max, min) {
2026 assert(typeof value === 'number', 'cannot write a non-number as a number')

Callers 3

mathbox-core.jsFile · 0.70
_writeUInt16Function · 0.70
_writeUInt32Function · 0.70

Calls 1

assertFunction · 0.70

Tested by

no test coverage detected