HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fpreal16Limits.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
4 // Digital Ltd. LLC
5 //
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
10 // met:
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
16 // distribution.
17 // * Neither the name of Industrial Light & Magic nor the names of
18 // its contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
33 ///////////////////////////////////////////////////////////////////////////
34 
35 
36 // Primary authors:
37 // Florian Kainz <kainz@ilm.com>
38 // Rod Bogart <rgb@ilm.com>
39 
40 
41 #ifndef __FPREAL16LIMITS_H_INCLUDED__
42 #define __FPREAL16LIMITS_H_INCLUDED__
43 
44 
45 //------------------------------------------------------------------------
46 //
47 // C++ standard library-style numeric_limits for class fpreal16
48 //
49 //------------------------------------------------------------------------
50 
51 #include "SYS_Types.h"
52 #include <limits>
53 
54 namespace std {
55 
56 template <>
57 class numeric_limits <fpreal16>
58 {
59 public:
60 
61  static const bool is_specialized = true;
62 
63  static fpreal16 min() noexcept {return H_REAL16_NRM_MIN;}
64  static fpreal16 max() noexcept {return H_REAL16_MAX;}
65 
66  static const int digits = H_REAL16_MANT_DIG;
67  static const int digits10 = H_REAL16_DIG;
68  static const bool is_signed = true;
69  static const bool is_integer = false;
70  static const bool is_exact = false;
71  static const int radix = H_REAL16_RADIX;
72 
73  static fpreal16 epsilon() noexcept {return H_REAL16_EPSILON;}
74  static fpreal16 round_error() noexcept {return H_REAL16_EPSILON / 2;}
75 
76  static const int min_exponent = H_REAL16_MIN_EXP;
77  static const int min_exponent10 = H_REAL16_MIN_10_EXP;
78  static const int max_exponent = H_REAL16_MAX_EXP;
79  static const int max_exponent10 = H_REAL16_MAX_10_EXP;
80 
81  static const bool has_infinity = true;
82  static const bool has_quiet_NaN = true;
83  static const bool has_signaling_NaN = true;
84  static const float_denorm_style
85  has_denorm = denorm_present;
86  static const bool has_denorm_loss = false;
87 
88  static fpreal16 infinity() noexcept {return fpreal16::posInf();}
89  static fpreal16 quiet_NaN() noexcept {return fpreal16::qNan();}
90  static fpreal16 signaling_NaN() noexcept {return fpreal16::sNan();}
91  static fpreal16 denorm_min() noexcept {return H_REAL16_MIN;}
92 
93  static const bool is_iec559 = false;
94  static const bool is_bounded = false;
95  static const bool is_modulo = false;
96 
97  static const bool traps = true;
98  static const bool tinyness_before = false;
99  static const float_round_style
100  round_style = round_to_nearest;
101 };
102 
103 } // namespace std
104 
105 #endif // __FPREAL16LIMITS_H_INCLUDED__
static fpreal16 quiet_NaN() noexcept
static fpreal16 denorm_min() noexcept
static fpreal16 round_error() noexcept
#define H_REAL16_MAX_10_EXP
Definition: fpreal16.h:297
static fpreal16 infinity() noexcept
#define H_REAL16_EPSILON
Definition: fpreal16.h:273
#define H_REAL16_MAX
Definition: fpreal16.h:270
static fpreal16 qNan()
Definition: fpreal16.h:715
static fpreal16 epsilon() noexcept
#define H_REAL16_MAX_EXP
Definition: fpreal16.h:288
#define H_REAL16_MIN_EXP
Definition: fpreal16.h:283
#define H_REAL16_RADIX
Definition: fpreal16.h:281
static fpreal16 min() noexcept
static fpreal16 sNan()
Definition: fpreal16.h:724
#define H_REAL16_MANT_DIG
Definition: fpreal16.h:275
static fpreal16 signaling_NaN() noexcept
#define H_REAL16_DIG
Definition: fpreal16.h:278
#define H_REAL16_NRM_MIN
Definition: fpreal16.h:268
static fpreal16 posInf()
Definition: fpreal16.h:697
static fpreal16 max() noexcept
#define H_REAL16_MIN_10_EXP
Definition: fpreal16.h:293
#define H_REAL16_MIN
Definition: fpreal16.h:267