halfLimits.h
Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
00004 // Digital Ltd. LLC
00005 // 
00006 // All rights reserved.
00007 // 
00008 // Redistribution and use in source and binary forms, with or without
00009 // modification, are permitted provided that the following conditions are
00010 // met:
00011 // *       Redistributions of source code must retain the above copyright
00012 // notice, this list of conditions and the following disclaimer.
00013 // *       Redistributions in binary form must reproduce the above
00014 // copyright notice, this list of conditions and the following disclaimer
00015 // in the documentation and/or other materials provided with the
00016 // distribution.
00017 // *       Neither the name of Industrial Light & Magic nor the names of
00018 // its contributors may be used to endorse or promote products derived
00019 // from this software without specific prior written permission. 
00020 // 
00021 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00024 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00025 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00026 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00027 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00028 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00029 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00030 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032 //
00034 
00035 
00036 // Primary authors:
00037 //     Florian Kainz <kainz@ilm.com>
00038 //     Rod Bogart <rgb@ilm.com>
00039 
00040 
00041 #ifndef INCLUDED_HALF_LIMITS_H
00042 #define INCLUDED_HALF_LIMITS_H
00043 
00044 
00045 //------------------------------------------------------------------------
00046 //
00047 //      C++ standard library-style numeric_limits for class half
00048 //
00049 //------------------------------------------------------------------------
00050 
00051 #ifdef HAVE_STL_LIMITS
00052 #include <limits>
00053 #include "half.h"
00054 
00055 namespace std {
00056 
00057 template <>
00058 class numeric_limits <half>
00059 {
00060   public:
00061 
00062     static const bool is_specialized = true;
00063 
00064     static half min () throw () {return HALF_NRM_MIN;}
00065     static half max () throw () {return HALF_MAX;}
00066 
00067     static const int digits = HALF_MANT_DIG;
00068     static const int digits10 = HALF_DIG;
00069     static const bool is_signed = true;
00070     static const bool is_integer = false;
00071     static const bool is_exact = false;
00072     static const int radix = HALF_RADIX;
00073     static half epsilon () throw () {return HALF_EPSILON;}
00074     static half round_error () throw () {return HALF_EPSILON / 2;}
00075 
00076     static const int min_exponent = HALF_MIN_EXP;
00077     static const int min_exponent10 = HALF_MIN_10_EXP;
00078     static const int max_exponent = HALF_MAX_EXP;
00079     static const int max_exponent10 = HALF_MAX_10_EXP;
00080 
00081     static const bool has_infinity = true;
00082     static const bool has_quiet_NaN = true;
00083     static const bool has_signaling_NaN = true;
00084     static const float_denorm_style has_denorm = denorm_present;
00085     static const bool has_denorm_loss = false;
00086     static half infinity () throw () {return half::posInf();}
00087     static half quiet_NaN () throw () {return half::qNan();}
00088     static half signaling_NaN () throw () {return half::sNan();}
00089     static half denorm_min () throw () {return HALF_MIN;}
00090 
00091     static const bool is_iec559 = false;
00092     static const bool is_bounded = false;
00093     static const bool is_modulo = false;
00094 
00095     static const bool traps = true;
00096     static const bool tinyness_before = false;
00097     static const float_round_style round_style = round_to_nearest;
00098 };
00099 
00100 
00101 } // namespace std
00102 
00103 #endif
00104 #endif


threemxl
Author(s):
autogenerated on Fri Aug 28 2015 13:21:08