00001 /* 00002 * Copyright (C) 2003-2009 Olivier Boudeville 00003 * 00004 * This file is part of the Ceylan library. 00005 * 00006 * The Ceylan library is free software: you can redistribute it and/or modify 00007 * it under the terms of either the GNU Lesser General Public License or 00008 * the GNU General Public License, as they are published by the Free Software 00009 * Foundation, either version 3 of these Licenses, or (at your option) 00010 * any later version. 00011 * 00012 * The Ceylan library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License and the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License and the GNU General Public License along with the Ceylan library. 00020 * If not, see <http://www.gnu.org/licenses/>. 00021 * 00022 * Author: Olivier Boudeville (olivier.boudeville@esperide.com) 00023 * 00024 */ 00025 00026 00027 #include "CeylanTypes.h" 00028 00029 00030 #include <limits> // for numeric_limits 00031 00032 00033 using namespace std ; 00034 00035 00036 00037 // Must be -128: 00038 Ceylan::Sint8 Ceylan::Sint8Min = numeric_limits<Ceylan::Sint8>::min() ; 00039 00040 // Must be 127: 00041 Ceylan::Sint8 Ceylan::Sint8Max = numeric_limits<Ceylan::Sint8>::max() ; 00042 00043 00044 00045 // Must be 0: 00046 Ceylan::Uint8 Ceylan::Uint8Min = numeric_limits<Ceylan::Uint8>::min() ; 00047 00048 // Must be 255: 00049 Ceylan::Uint8 Ceylan::Uint8Max = numeric_limits<Ceylan::Uint8>::max() ; 00050 00051 00052 00053 // Should be -128: 00054 Ceylan::Byte Ceylan::ByteMin = numeric_limits<Ceylan::Byte>::min() ; 00055 00056 // Should be 127: 00057 Ceylan::Byte Ceylan::ByteMax = numeric_limits<Ceylan::Byte>::max() ; 00058 00059 00060 00061 00062 // Must be -32768: 00063 Ceylan::Sint16 Ceylan::Sint16Min = numeric_limits<Ceylan::Sint16>::min() ; 00064 00065 // Must be 32767: 00066 Ceylan::Sint16 Ceylan::Sint16Max = numeric_limits<Ceylan::Sint16>::max() ; 00067 00068 00069 // Must be 0: 00070 Ceylan::Uint16 Ceylan::Uint16Min = numeric_limits<Ceylan::Uint16>::min() ; 00071 00072 // Must be 65535: 00073 Ceylan::Uint16 Ceylan::Uint16Max = numeric_limits<Ceylan::Uint16>::max() ; 00074 00075 00076 00077 // Must be -2147483648: 00078 Ceylan::Sint32 Ceylan::Sint32Min = numeric_limits<Ceylan::Sint32>::min() ; 00079 00080 // Must be 2147483647: 00081 Ceylan::Sint32 Ceylan::Sint32Max = numeric_limits<Ceylan::Sint32>::max() ; 00082 00083 00084 // Must be 0: 00085 Ceylan::Uint32 Ceylan::Uint32Min = numeric_limits<Ceylan::Uint32>::min() ; 00086 00087 // Must be 4294967294: 00088 Ceylan::Uint32 Ceylan::Uint32Max = numeric_limits<Ceylan::Uint32>::max() ; 00089 00090 00091 00092 00093 // Depends on the platform: 00094 Ceylan::SignedLongInteger Ceylan::SignedLongIntegerMin 00095 = numeric_limits<Ceylan::SignedLongInteger>::min() ; 00096 00097 // Depends on the platform: 00098 Ceylan::SignedLongInteger Ceylan::SignedLongIntegerMax 00099 = numeric_limits<Ceylan::SignedLongInteger>::max() ; 00100 00101 00102 00103 // Depends on the platform: 00104 Ceylan::UnsignedLongInteger Ceylan::UnsignedLongIntegerMin 00105 = numeric_limits<Ceylan::UnsignedLongInteger>::min() ; 00106 00107 // Depends on the platform: 00108 Ceylan::UnsignedLongInteger Ceylan::UnsignedLongIntegerMax 00109 = numeric_limits<Ceylan::UnsignedLongInteger>::max() ; 00110 00111 00112 00113 /* 00114 * Actually with the STL, for floating-point values the min returns something 00115 * like epsilon (the smallest value that can be added to 1.0 to yield a 00116 * different value), whereas we want the lower bound. 00117 * 00118 * Hence min is deduced from max instead. 00119 * 00120 */ 00121 00122 00123 // Must be -3.4E-38f: 00124 Ceylan::Float32 Ceylan::Float32Min = -numeric_limits<Ceylan::Float32>::max() ; 00125 00126 // Must be 3.4E38f: 00127 Ceylan::Float32 Ceylan::Float32Max = numeric_limits<Ceylan::Float32>::max() ; 00128 00129 00130 00131 // Must be -1.7E-308: 00132 Ceylan::Float64 Ceylan::Float64Min = -numeric_limits<Ceylan::Float64>::max() ; 00133 00134 // Must be 1.7E308: 00135 Ceylan::Float64 Ceylan::Float64Max = numeric_limits<Ceylan::Float64>::max() ; 00136 00137 00138 00139 // Depends on the platform: 00140 Ceylan::LongFloat Ceylan::LongFloatMin 00141 = -numeric_limits<Ceylan::LongFloat>::max() ; 00142 00143 // Depends on the platform: 00144 Ceylan::LongFloat Ceylan::LongFloatMax 00145 = numeric_limits<Ceylan::LongFloat>::max() ; 00146 00147 00148 00149 //Ceylan::Float80 Ceylan::Float80Min = -3.4E-4932 ; 00150 00151 // Should have been 3.4E4932: 00152 //Ceylan::Float80 Ceylan::Float80Max = 1.7E308 ; 00153