ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
maxmin.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 
00017 double max(const double u, const double v)
00018 {
00019   return u > v ? u : v;
00020 }
00021 
00026 double min(const double u, const double v)
00027 {
00028   return u < v ? u : v;
00029 }
00030 
00035 unsigned long max(unsigned long u, unsigned long v)
00036 {
00037   return u > v ? u : v;
00038 }
00039 
00044 unsigned long min(unsigned long u, unsigned long v)
00045 {
00046   return u < v ? u : v;
00047 }