text: /**
   * Copyright (c) 2017-present, Facebook, Inc.
   * All rights reserved.
   *
   * This source code is licensed under the BSD-style license found in the
   * LICENSE file in the root directory of this source tree. An additional grant
   * of patent rights can be found in the PATENTS file in the same directory.
   */
  #pragma once
  
  #ifndef HELPERS_MATH_H_
  #define HELPERS_MATH_H_
  
  #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
  #define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
  
  #define CONSTRAIN(x, min, max) MIN(MAX((x), (min)), (max))
  
  #endif /* HELPERS_MATH_H_ */
  