Path: blob/master/3rdparty/openexr/Half/halfLimits.h
16337 views
///////////////////////////////////////////////////////////////////////////1//2// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas3// Digital Ltd. LLC4//5// All rights reserved.6//7// Redistribution and use in source and binary forms, with or without8// modification, are permitted provided that the following conditions are9// met:10// * Redistributions of source code must retain the above copyright11// notice, this list of conditions and the following disclaimer.12// * Redistributions in binary form must reproduce the above13// copyright notice, this list of conditions and the following disclaimer14// in the documentation and/or other materials provided with the15// distribution.16// * Neither the name of Industrial Light & Magic nor the names of17// its contributors may be used to endorse or promote products derived18// from this software without specific prior written permission.19//20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS21// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT22// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR23// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT24// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT26// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,27// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY28// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE30// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31//32///////////////////////////////////////////////////////////////////////////333435// Primary authors:36// Florian Kainz <[email protected]>37// Rod Bogart <[email protected]>383940#ifndef INCLUDED_HALF_LIMITS_H41#define INCLUDED_HALF_LIMITS_H424344//------------------------------------------------------------------------45//46// C++ standard library-style numeric_limits for class half47//48//------------------------------------------------------------------------4950#include <limits>51#include "half.h"5253namespace std {5455template <>56class numeric_limits <half>57{58public:5960static const bool is_specialized = true;6162static half min () throw () {return HALF_NRM_MIN;}63static half max () throw () {return HALF_MAX;}6465static const int digits = HALF_MANT_DIG;66static const int digits10 = HALF_DIG;67static const bool is_signed = true;68static const bool is_integer = false;69static const bool is_exact = false;70static const int radix = HALF_RADIX;71static half epsilon () throw () {return HALF_EPSILON;}72static half round_error () throw () {return HALF_EPSILON / 2;}7374static const int min_exponent = HALF_MIN_EXP;75static const int min_exponent10 = HALF_MIN_10_EXP;76static const int max_exponent = HALF_MAX_EXP;77static const int max_exponent10 = HALF_MAX_10_EXP;7879static const bool has_infinity = true;80static const bool has_quiet_NaN = true;81static const bool has_signaling_NaN = true;82static const float_denorm_style has_denorm = denorm_present;83static const bool has_denorm_loss = false;84static half infinity () throw () {return half::posInf();}85static half quiet_NaN () throw () {return half::qNan();}86static half signaling_NaN () throw () {return half::sNan();}87static half denorm_min () throw () {return HALF_MIN;}8889static const bool is_iec559 = false;90static const bool is_bounded = false;91static const bool is_modulo = false;9293static const bool traps = true;94static const bool tinyness_before = false;95static const float_round_style round_style = round_to_nearest;96};979899} // namespace std100101#endif102103104