UNPKG

345 BJavaScriptView Raw
1import { csFlip } from './csFlip'
2
3/**
4 * Flips the value if it is negative of returns the same value otherwise.
5 *
6 * @param {Number} i The value to flip
7 *
8 * Reference: http://faculty.cse.tamu.edu/davis/publications.html
9 */
10export function csUnflip (i) {
11 // flip the value if it is negative
12 return i < 0 ? csFlip(i) : i
13}