simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

csUnflip.js (348B)


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