A fixed point library from Trenki http://www.trenki.net/content/view/17/1/ Slightly modified so that the fixed point data structure can automatically cast itself to float or int when used in an expression.
Revision 0:aa2871c4c041, committed 2010-10-20
- Comitter:
- sravet
- Date:
- Wed Oct 20 02:20:46 2010 +0000
- Commit message:
- First checkin.
Changed in this revision
diff -r 000000000000 -r aa2871c4c041 fixed_class.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fixed_class.h Wed Oct 20 02:20:46 2010 +0000 @@ -0,0 +1,189 @@ +/* +Copyright (c) 2007, Markus Trenkwalder + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the library's copyright owner nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef FIXEDP_CLASS_H_INCLUDED +#define FIXEDP_CLASS_H_INCLUDED + +#ifdef _MSC_VER +#pragma once +#endif + +#include "fixed_func.h" + +namespace fixedpoint { + +// The template argument p in all of the following functions refers to the +// fixed point precision (e.g. p = 8 gives 24.8 fixed point functions). + +template <int p> +struct fixed_point { + int32_t intValue; + + fixed_point() {} + /*explicit*/ fixed_point(int32_t i) : intValue(i << p) {} + /*explicit*/ fixed_point(float f) : intValue(float2fix<p>(f)) {} + /*explicit*/ fixed_point(double f) : intValue(float2fix<p>((float)f)) {} + + fixed_point& operator += (fixed_point r) { intValue += r.intValue; return *this; } + fixed_point& operator -= (fixed_point r) { intValue -= r.intValue; return *this; } + fixed_point& operator *= (fixed_point r) { intValue = fixmul<p>(intValue, r.intValue); return *this; } + fixed_point& operator /= (fixed_point r) { intValue = fixdiv<p>(intValue, r.intValue); return *this; } + + fixed_point& operator *= (int32_t r) { intValue *= r; return *this; } + fixed_point& operator /= (int32_t r) { intValue /= r; return *this; } + + fixed_point operator - () const { fixed_point x; x.intValue = -intValue; return x; } + fixed_point operator + (fixed_point r) const { fixed_point x = *this; x += r; return x;} + fixed_point operator - (fixed_point r) const { fixed_point x = *this; x -= r; return x;} + fixed_point operator * (fixed_point r) const { fixed_point x = *this; x *= r; return x;} + fixed_point operator / (fixed_point r) const { fixed_point x = *this; x /= r; return x;} + + bool operator == (fixed_point r) const { return intValue == r.intValue; } + bool operator != (fixed_point r) const { return !(*this == r); } + bool operator < (fixed_point r) const { return intValue < r.intValue; } + bool operator > (fixed_point r) const { return intValue > r.intValue; } + bool operator <= (fixed_point r) const { return intValue <= r.intValue; } + bool operator >= (fixed_point r) const { return intValue >= r.intValue; } + + fixed_point operator + (int32_t r) const { fixed_point x = *this; x += r; return x;} + fixed_point operator - (int32_t r) const { fixed_point x = *this; x -= r; return x;} + fixed_point operator * (int32_t r) const { fixed_point x = *this; x *= r; return x;} + fixed_point operator / (int32_t r) const { fixed_point x = *this; x /= r; return x;} + operator int() const { return intValue>>p; } + operator float() const { return fix2float<p>(intValue); } +}; + +// Specializations for use with plain integers +template <int p> +inline fixed_point<p> operator + (int32_t a, fixed_point<p> b) +{ return b + a; } + +template <int p> +inline fixed_point<p> operator - (int32_t a, fixed_point<p> b) +{ return -b + a; } + +template <int p> +inline fixed_point<p> operator * (int32_t a, fixed_point<p> b) +{ return b * a; } + +template <int p> +inline fixed_point<p> operator / (int32_t a, fixed_point<p> b) +{ fixed_point<p> r(a); r /= b; return r; } + +// math functions +// no default implementation + +template <int p> +inline fixed_point<p> sin(fixed_point<p> a); + +template <int p> +inline fixed_point<p> cos(fixed_point<p> a); + +template <int p> +inline fixed_point<p> sqrt(fixed_point<p> a); + +template <int p> +inline fixed_point<p> rsqrt(fixed_point<p> a); + +template <int p> +inline fixed_point<p> inv(fixed_point<p> a); + +template <int p> +inline fixed_point<p> abs(fixed_point<p> a) +{ + fixed_point<p> r; + r.intValue = a.intValue > 0 ? a.intValue : -a.intValue; + return r; +} + +// specializations for 16.16 format + +template <> +inline fixed_point<16> sin(fixed_point<16> a) +{ + fixed_point<16> r; + r.intValue = fixsin16(a.intValue); + return r; +} + +template <> +inline fixed_point<16> cos(fixed_point<16> a) +{ + fixed_point<16> r; + r.intValue = fixcos16(a.intValue); + return r; +} + + +template <> +inline fixed_point<16> sqrt(fixed_point<16> a) +{ + fixed_point<16> r; + r.intValue = fixsqrt16(a.intValue); + return r; +} + +template <> +inline fixed_point<16> rsqrt(fixed_point<16> a) +{ + fixed_point<16> r; + r.intValue = fixrsqrt16(a.intValue); + return r; +} + +template <> +inline fixed_point<16> inv(fixed_point<16> a) +{ + fixed_point<16> r; + r.intValue = fixinv<16>(a.intValue); + return r; +} + +// The multiply accumulate case can be optimized. +template <int p> +inline fixed_point<p> multiply_accumulate( + int count, + const fixed_point<p> *a, + const fixed_point<p> *b) +{ + long long result = 0; + for (int i = 0; i < count; ++i) + result += static_cast<long long>(a[i].intValue) * b[i].intValue; + fixed_point<p> r; + r.intValue = static_cast<int>(result >> p); + return r; +} + +} // end namespace fixedpoint + +#endif +
diff -r 000000000000 -r aa2871c4c041 fixed_func.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fixed_func.cpp Wed Oct 20 02:20:46 2010 +0000 @@ -0,0 +1,133 @@ +/* +Copyright (c) 2007, Markus Trenkwalder + +Portions taken from the Vicent 3D rendering library +Copyright (c) 2004, David Blythe, Hans Martin Will + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the library's copyright owner nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "fixed_func.h" + +namespace fixedpoint { + +static const int32_t FIX16_2PI = float2fix<16>(6.28318530717958647692f); +static const int32_t FIX16_R2PI = float2fix<16>(1.0f/6.28318530717958647692f); + +static const uint16_t sin_tab[] = { +#include "fixsintab.h" +}; + +int32_t fixcos16(int32_t a) +{ + int32_t v; + /* reduce to [0,1) */ + while (a < 0) a += FIX16_2PI; + a = fixmul<16>(a, FIX16_R2PI); + a += 0x4000; + + /* now in the range [0, 0xffff], reduce to [0, 0xfff] */ + a >>= 4; + + v = (a & 0x400) ? sin_tab[0x3ff - (a & 0x3ff)] : sin_tab[a & 0x3ff]; + v = fixmul<16>(v, 1 << 16); + return (a & 0x800) ? -v : v; +} + +int32_t fixsin16(int32_t a) +{ + int32_t v; + + /* reduce to [0,1) */ + while (a < 0) a += FIX16_2PI; + a = fixmul<16>(a, FIX16_R2PI); + + /* now in the range [0, 0xffff], reduce to [0, 0xfff] */ + a >>= 4; + + v = (a & 0x400) ? sin_tab[0x3ff - (a & 0x3ff)] : sin_tab[a & 0x3ff]; + v = fixmul<16>(v, 1 << 16); + return (a & 0x800) ? -v : v; +} + +int32_t fixrsqrt16(int32_t a) +{ + int32_t x; + + static const uint16_t rsq_tab[] = { /* domain 0.5 .. 1.0-1/16 */ + 0xb504, 0xaaaa, 0xa1e8, 0x9a5f, 0x93cd, 0x8e00, 0x88d6, 0x8432, + }; + + int32_t i, exp; + if (a == 0) return 0x7fffffff; + if (a == (1<<16)) return a; + + exp = detail::CountLeadingZeros(a); + x = rsq_tab[(a>>(28-exp))&0x7]<<1; + + exp -= 16; + if (exp <= 0) + x >>= -exp>>1; + else + x <<= (exp>>1)+(exp&1); + if (exp&1) x = fixmul<16>(x, rsq_tab[0]); + + + /* newton-raphson */ + /* x = x/2*(3-(a*x)*x) */ + i = 0; + do { + + x = fixmul<16>((x>>1),((1<<16)*3 - fixmul<16>(fixmul<16>(a,x),x))); + } while(++i < 3); + + return x; +} + +static inline int32_t fast_div16(int32_t a, int32_t b) +{ + if ((b >> 24) && (b >> 24) + 1) { + return fixmul<16>(a >> 8, fixinv<16>(b >> 8)); + } else { + return fixmul<16>(a, fixinv<16>(b)); + } +} + +int32_t fixsqrt16(int32_t a) +{ + int32_t s; + int32_t i; + s = (a + (1<<16)) >> 1; + /* 6 iterations to converge */ + for (i = 0; i < 6; i++) + s = (s + fast_div16(a, s)) >> 1; + return s; +} + +} // end namespace fixedpoint
diff -r 000000000000 -r aa2871c4c041 fixed_func.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fixed_func.h Wed Oct 20 02:20:46 2010 +0000 @@ -0,0 +1,184 @@ +/* +Copyright (c) 2007, Markus Trenkwalder + +Portions taken from the Vicent 3D rendering library +Copyright (c) 2004, David Blythe, Hans Martin Will + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the library's copyright owner nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef FIXEDP_FUNC_H_INCLUDED +#define FIXEDP_FUNC_H_INCLUDED + +#ifdef _MSC_VER +#pragma once +#endif + +#ifndef _MSC_VER +#include <stdint.h> +#else +#include "stdint.h" +#endif + +namespace fixedpoint { + +// The template argument p in all of the following functions refers to the +// fixed point precision (e.g. p = 8 gives 24.8 fixed point functions). + +// Perform a fixed point multiplication without a 64-bit intermediate result. +// This is fast but beware of overflow! +template <int p> +inline int32_t fixmulf(int32_t a, int32_t b) +{ + return (a * b) >> p; +} + +// Perform a fixed point multiplication using a 64-bit intermediate result to +// prevent overflow problems. +template <int p> +inline int32_t fixmul(int32_t a, int32_t b) +{ + return (int32_t)(((int64_t)a * b) >> p); +} + +// Fixed point division +template <int p> +inline int fixdiv(int32_t a, int32_t b) +{ +#if 0 + return (int32_t)((((int64_t)a) << p) / b); +#else + // The following produces the same results as the above but gcc 4.0.3 + // generates fewer instructions (at least on the ARM processor). + union { + int64_t a; + struct { + int32_t l; + int32_t h; + }; + } x; + + x.l = a << p; + x.h = a >> (sizeof(int32_t) * 8 - p); + return (int32_t)(x.a / b); +#endif +} + +namespace detail { + inline uint32_t CountLeadingZeros(uint32_t x) + { + uint32_t exp = 31; + + if (x & 0xffff0000) { + exp -= 16; + x >>= 16; + } + + if (x & 0xff00) { + exp -= 8; + x >>= 8; + } + + if (x & 0xf0) { + exp -= 4; + x >>= 4; + } + + if (x & 0xc) { + exp -= 2; + x >>= 2; + } + + if (x & 0x2) { + exp -= 1; + } + + return exp; + } +} + +// q is the precision of the input +// output has 32-q bits of fraction +template <int q> +inline int fixinv(int32_t a) +{ + int32_t x; + + bool sign = false; + + if (a < 0) { + sign = true; + a = -a; + } + + static const uint16_t rcp_tab[] = { + 0x8000, 0x71c7, 0x6666, 0x5d17, 0x5555, 0x4ec4, 0x4924, 0x4444 + }; + + int32_t exp = detail::CountLeadingZeros(a); + x = ((int32_t)rcp_tab[(a>>(28-exp))&0x7]) << 2; + exp -= 16; + + if (exp <= 0) + x >>= -exp; + else + x <<= exp; + + /* two iterations of newton-raphson x = x(2-ax) */ + x = fixmul<(32-q)>(x,((2<<(32-q)) - fixmul<q>(a,x))); + x = fixmul<(32-q)>(x,((2<<(32-q)) - fixmul<q>(a,x))); + + if (sign) + return -x; + else + return x; +} + +// Conversion from and to float + +template <int p> +float fix2float(int32_t f) +{ + return (float)f / (1 << p); +} + +template <int p> +int32_t float2fix(float f) +{ + return (int32_t)(f * (1 << p)); +} + +int32_t fixcos16(int32_t a); +int32_t fixsin16(int32_t a); +int32_t fixrsqrt16(int32_t a); +int32_t fixsqrt16(int32_t a); + +} // end namespace fixedpoint + +#endif
diff -r 000000000000 -r aa2871c4c041 fixsintab.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fixsintab.h Wed Oct 20 02:20:46 2010 +0000 @@ -0,0 +1,1024 @@ +0x0000, /* 0.000000 0.000000 */ +0x0064, /* 0.001535 0.001535 */ +0x00c9, /* 0.003071 0.003071 */ +0x012d, /* 0.004606 0.004606 */ +0x0192, /* 0.006142 0.006142 */ +0x01f7, /* 0.007677 0.007677 */ +0x025b, /* 0.009213 0.009213 */ +0x02c0, /* 0.010748 0.010748 */ +0x0325, /* 0.012284 0.012284 */ +0x0389, /* 0.013819 0.013819 */ +0x03ee, /* 0.015355 0.015354 */ +0x0452, /* 0.016890 0.016889 */ +0x04b7, /* 0.018426 0.018425 */ +0x051c, /* 0.019961 0.019960 */ +0x0580, /* 0.021497 0.021495 */ +0x05e5, /* 0.023032 0.023030 */ +0x0649, /* 0.024568 0.024565 */ +0x06ae, /* 0.026103 0.026100 */ +0x0713, /* 0.027639 0.027635 */ +0x0777, /* 0.029174 0.029170 */ +0x07dc, /* 0.030710 0.030705 */ +0x0840, /* 0.032245 0.032239 */ +0x08a5, /* 0.033781 0.033774 */ +0x0909, /* 0.035316 0.035309 */ +0x096e, /* 0.036852 0.036843 */ +0x09d3, /* 0.038387 0.038378 */ +0x0a37, /* 0.039922 0.039912 */ +0x0a9c, /* 0.041458 0.041446 */ +0x0b00, /* 0.042993 0.042980 */ +0x0b65, /* 0.044529 0.044514 */ +0x0bc9, /* 0.046064 0.046048 */ +0x0c2e, /* 0.047600 0.047582 */ +0x0c92, /* 0.049135 0.049116 */ +0x0cf7, /* 0.050671 0.050649 */ +0x0d5b, /* 0.052206 0.052183 */ +0x0dc0, /* 0.053742 0.053716 */ +0x0e24, /* 0.055277 0.055249 */ +0x0e89, /* 0.056813 0.056782 */ +0x0eed, /* 0.058348 0.058315 */ +0x0f52, /* 0.059884 0.059848 */ +0x0fb6, /* 0.061419 0.061381 */ +0x101b, /* 0.062955 0.062913 */ +0x107f, /* 0.064490 0.064445 */ +0x10e3, /* 0.066026 0.065978 */ +0x1148, /* 0.067561 0.067510 */ +0x11ac, /* 0.069097 0.069042 */ +0x1211, /* 0.070632 0.070573 */ +0x1275, /* 0.072168 0.072105 */ +0x12d9, /* 0.073703 0.073636 */ +0x133e, /* 0.075239 0.075168 */ +0x13a2, /* 0.076774 0.076699 */ +0x1406, /* 0.078309 0.078229 */ +0x146b, /* 0.079845 0.079760 */ +0x14cf, /* 0.081380 0.081291 */ +0x1533, /* 0.082916 0.082821 */ +0x1597, /* 0.084451 0.084351 */ +0x15fc, /* 0.085987 0.085881 */ +0x1660, /* 0.087522 0.087411 */ +0x16c4, /* 0.089058 0.088940 */ +0x1728, /* 0.090593 0.090469 */ +0x178d, /* 0.092129 0.091999 */ +0x17f1, /* 0.093664 0.093527 */ +0x1855, /* 0.095200 0.095056 */ +0x18b9, /* 0.096735 0.096584 */ +0x191d, /* 0.098271 0.098113 */ +0x1981, /* 0.099806 0.099641 */ +0x19e6, /* 0.101342 0.101168 */ +0x1a4a, /* 0.102877 0.102696 */ +0x1aae, /* 0.104413 0.104223 */ +0x1b12, /* 0.105948 0.105750 */ +0x1b76, /* 0.107484 0.107277 */ +0x1bda, /* 0.109019 0.108803 */ +0x1c3e, /* 0.110555 0.110330 */ +0x1ca2, /* 0.112090 0.111855 */ +0x1d06, /* 0.113626 0.113381 */ +0x1d6a, /* 0.115161 0.114907 */ +0x1dce, /* 0.116697 0.116432 */ +0x1e32, /* 0.118232 0.117957 */ +0x1e96, /* 0.119767 0.119481 */ +0x1efa, /* 0.121303 0.121006 */ +0x1f5d, /* 0.122838 0.122530 */ +0x1fc1, /* 0.124374 0.124054 */ +0x2025, /* 0.125909 0.125577 */ +0x2089, /* 0.127445 0.127100 */ +0x20ed, /* 0.128980 0.128623 */ +0x2151, /* 0.130516 0.130146 */ +0x21b4, /* 0.132051 0.131668 */ +0x2218, /* 0.133587 0.133190 */ +0x227c, /* 0.135122 0.134711 */ +0x22e0, /* 0.136658 0.136233 */ +0x2343, /* 0.138193 0.137754 */ +0x23a7, /* 0.139729 0.139274 */ +0x240a, /* 0.141264 0.140795 */ +0x246e, /* 0.142800 0.142315 */ +0x24d2, /* 0.144335 0.143835 */ +0x2535, /* 0.145871 0.145354 */ +0x2599, /* 0.147406 0.146873 */ +0x25fc, /* 0.148942 0.148392 */ +0x2660, /* 0.150477 0.149910 */ +0x26c3, /* 0.152013 0.151428 */ +0x2727, /* 0.153548 0.152945 */ +0x278a, /* 0.155084 0.154463 */ +0x27ee, /* 0.156619 0.155979 */ +0x2851, /* 0.158154 0.157496 */ +0x28b4, /* 0.159690 0.159012 */ +0x2918, /* 0.161225 0.160528 */ +0x297b, /* 0.162761 0.162043 */ +0x29de, /* 0.164296 0.163558 */ +0x2a42, /* 0.165832 0.165073 */ +0x2aa5, /* 0.167367 0.166587 */ +0x2b08, /* 0.168903 0.168101 */ +0x2b6b, /* 0.170438 0.169614 */ +0x2bce, /* 0.171974 0.171127 */ +0x2c31, /* 0.173509 0.172640 */ +0x2c95, /* 0.175045 0.174152 */ +0x2cf8, /* 0.176580 0.175664 */ +0x2d5b, /* 0.178116 0.177175 */ +0x2dbe, /* 0.179651 0.178686 */ +0x2e21, /* 0.181187 0.180197 */ +0x2e84, /* 0.182722 0.181707 */ +0x2ee7, /* 0.184258 0.183217 */ +0x2f4a, /* 0.185793 0.184726 */ +0x2fac, /* 0.187329 0.186235 */ +0x300f, /* 0.188864 0.187743 */ +0x3072, /* 0.190400 0.189251 */ +0x30d5, /* 0.191935 0.190759 */ +0x3138, /* 0.193471 0.192266 */ +0x319a, /* 0.195006 0.193772 */ +0x31fd, /* 0.196541 0.195279 */ +0x3260, /* 0.198077 0.196784 */ +0x32c2, /* 0.199612 0.198289 */ +0x3325, /* 0.201148 0.199794 */ +0x3388, /* 0.202683 0.201299 */ +0x33ea, /* 0.204219 0.202802 */ +0x344d, /* 0.205754 0.204306 */ +0x34af, /* 0.207290 0.205809 */ +0x3512, /* 0.208825 0.207311 */ +0x3574, /* 0.210361 0.208813 */ +0x35d6, /* 0.211896 0.210314 */ +0x3639, /* 0.213432 0.211815 */ +0x369b, /* 0.214967 0.213315 */ +0x36fd, /* 0.216503 0.214815 */ +0x3760, /* 0.218038 0.216315 */ +0x37c2, /* 0.219574 0.217814 */ +0x3824, /* 0.221109 0.219312 */ +0x3886, /* 0.222645 0.220810 */ +0x38e8, /* 0.224180 0.222307 */ +0x394a, /* 0.225716 0.223804 */ +0x39ad, /* 0.227251 0.225300 */ +0x3a0f, /* 0.228787 0.226796 */ +0x3a71, /* 0.230322 0.228291 */ +0x3ad3, /* 0.231858 0.229786 */ +0x3b34, /* 0.233393 0.231280 */ +0x3b96, /* 0.234928 0.232773 */ +0x3bf8, /* 0.236464 0.234266 */ +0x3c5a, /* 0.237999 0.235759 */ +0x3cbc, /* 0.239535 0.237251 */ +0x3d1d, /* 0.241070 0.238742 */ +0x3d7f, /* 0.242606 0.240233 */ +0x3de1, /* 0.244141 0.241723 */ +0x3e42, /* 0.245677 0.243213 */ +0x3ea4, /* 0.247212 0.244702 */ +0x3f06, /* 0.248748 0.246191 */ +0x3f67, /* 0.250283 0.247678 */ +0x3fc9, /* 0.251819 0.249166 */ +0x402a, /* 0.253354 0.250653 */ +0x408b, /* 0.254890 0.252139 */ +0x40ed, /* 0.256425 0.253624 */ +0x414e, /* 0.257961 0.255109 */ +0x41af, /* 0.259496 0.256594 */ +0x4211, /* 0.261032 0.258077 */ +0x4272, /* 0.262567 0.259561 */ +0x42d3, /* 0.264103 0.261043 */ +0x4334, /* 0.265638 0.262525 */ +0x4395, /* 0.267174 0.264006 */ +0x43f6, /* 0.268709 0.265487 */ +0x4457, /* 0.270245 0.266967 */ +0x44b8, /* 0.271780 0.268447 */ +0x4519, /* 0.273315 0.269925 */ +0x457a, /* 0.274851 0.271404 */ +0x45db, /* 0.276386 0.272881 */ +0x463c, /* 0.277922 0.274358 */ +0x469c, /* 0.279457 0.275834 */ +0x46fd, /* 0.280993 0.277310 */ +0x475e, /* 0.282528 0.278785 */ +0x47be, /* 0.284064 0.280259 */ +0x481f, /* 0.285599 0.281733 */ +0x487f, /* 0.287135 0.283206 */ +0x48e0, /* 0.288670 0.284678 */ +0x4940, /* 0.290206 0.286149 */ +0x49a1, /* 0.291741 0.287620 */ +0x4a01, /* 0.293277 0.289091 */ +0x4a61, /* 0.294812 0.290560 */ +0x4ac2, /* 0.296348 0.292029 */ +0x4b22, /* 0.297883 0.293497 */ +0x4b82, /* 0.299419 0.294965 */ +0x4be2, /* 0.300954 0.296432 */ +0x4c42, /* 0.302490 0.297898 */ +0x4ca2, /* 0.304025 0.299363 */ +0x4d02, /* 0.305561 0.300828 */ +0x4d62, /* 0.307096 0.302292 */ +0x4dc2, /* 0.308632 0.303755 */ +0x4e22, /* 0.310167 0.305218 */ +0x4e82, /* 0.311703 0.306680 */ +0x4ee1, /* 0.313238 0.308141 */ +0x4f41, /* 0.314773 0.309601 */ +0x4fa1, /* 0.316309 0.311061 */ +0x5000, /* 0.317844 0.312520 */ +0x5060, /* 0.319380 0.313978 */ +0x50c0, /* 0.320915 0.315435 */ +0x511f, /* 0.322451 0.316892 */ +0x517e, /* 0.323986 0.318348 */ +0x51de, /* 0.325522 0.319803 */ +0x523d, /* 0.327057 0.321258 */ +0x529c, /* 0.328593 0.322711 */ +0x52fc, /* 0.330128 0.324164 */ +0x535b, /* 0.331664 0.325617 */ +0x53ba, /* 0.333199 0.327068 */ +0x5419, /* 0.334735 0.328519 */ +0x5478, /* 0.336270 0.329968 */ +0x54d7, /* 0.337806 0.331418 */ +0x5536, /* 0.339341 0.332866 */ +0x5595, /* 0.340877 0.334313 */ +0x55f4, /* 0.342412 0.335760 */ +0x5652, /* 0.343948 0.337206 */ +0x56b1, /* 0.345483 0.338651 */ +0x5710, /* 0.347019 0.340096 */ +0x576e, /* 0.348554 0.341539 */ +0x57cd, /* 0.350090 0.342982 */ +0x582b, /* 0.351625 0.344424 */ +0x588a, /* 0.353160 0.345865 */ +0x58e8, /* 0.354696 0.347305 */ +0x5946, /* 0.356231 0.348745 */ +0x59a5, /* 0.357767 0.350183 */ +0x5a03, /* 0.359302 0.351621 */ +0x5a61, /* 0.360838 0.353058 */ +0x5abf, /* 0.362373 0.354494 */ +0x5b1d, /* 0.363909 0.355930 */ +0x5b7b, /* 0.365444 0.357364 */ +0x5bd9, /* 0.366980 0.358798 */ +0x5c37, /* 0.368515 0.360231 */ +0x5c95, /* 0.370051 0.361663 */ +0x5cf3, /* 0.371586 0.363094 */ +0x5d51, /* 0.373122 0.364524 */ +0x5dae, /* 0.374657 0.365954 */ +0x5e0c, /* 0.376193 0.367382 */ +0x5e69, /* 0.377728 0.368810 */ +0x5ec7, /* 0.379264 0.370237 */ +0x5f24, /* 0.380799 0.371662 */ +0x5f82, /* 0.382335 0.373088 */ +0x5fdf, /* 0.383870 0.374512 */ +0x603c, /* 0.385406 0.375935 */ +0x609a, /* 0.386941 0.377357 */ +0x60f7, /* 0.388477 0.378779 */ +0x6154, /* 0.390012 0.380200 */ +0x61b1, /* 0.391547 0.381619 */ +0x620e, /* 0.393083 0.383038 */ +0x626b, /* 0.394618 0.384456 */ +0x62c8, /* 0.396154 0.385873 */ +0x6324, /* 0.397689 0.387289 */ +0x6381, /* 0.399225 0.388704 */ +0x63de, /* 0.400760 0.390119 */ +0x643b, /* 0.402296 0.391532 */ +0x6497, /* 0.403831 0.392944 */ +0x64f4, /* 0.405367 0.394356 */ +0x6550, /* 0.406902 0.395766 */ +0x65ac, /* 0.408438 0.397176 */ +0x6609, /* 0.409973 0.398585 */ +0x6665, /* 0.411509 0.399993 */ +0x66c1, /* 0.413044 0.401399 */ +0x671d, /* 0.414580 0.402805 */ +0x6779, /* 0.416115 0.404210 */ +0x67d5, /* 0.417651 0.405614 */ +0x6831, /* 0.419186 0.407017 */ +0x688d, /* 0.420722 0.408419 */ +0x68e9, /* 0.422257 0.409820 */ +0x6945, /* 0.423793 0.411220 */ +0x69a1, /* 0.425328 0.412620 */ +0x69fc, /* 0.426864 0.414018 */ +0x6a58, /* 0.428399 0.415415 */ +0x6ab3, /* 0.429934 0.416811 */ +0x6b0f, /* 0.431470 0.418207 */ +0x6b6a, /* 0.433005 0.419601 */ +0x6bc5, /* 0.434541 0.420994 */ +0x6c21, /* 0.436076 0.422386 */ +0x6c7c, /* 0.437612 0.423778 */ +0x6cd7, /* 0.439147 0.425168 */ +0x6d32, /* 0.440683 0.426557 */ +0x6d8d, /* 0.442218 0.427945 */ +0x6de8, /* 0.443754 0.429333 */ +0x6e43, /* 0.445289 0.430719 */ +0x6e9d, /* 0.446825 0.432104 */ +0x6ef8, /* 0.448360 0.433488 */ +0x6f53, /* 0.449896 0.434872 */ +0x6fad, /* 0.451431 0.436254 */ +0x7008, /* 0.452967 0.437635 */ +0x7062, /* 0.454502 0.439015 */ +0x70bd, /* 0.456038 0.440394 */ +0x7117, /* 0.457573 0.441772 */ +0x7171, /* 0.459109 0.443149 */ +0x71cb, /* 0.460644 0.444525 */ +0x7226, /* 0.462180 0.445900 */ +0x7280, /* 0.463715 0.447274 */ +0x72da, /* 0.465251 0.448647 */ +0x7333, /* 0.466786 0.450018 */ +0x738d, /* 0.468321 0.451389 */ +0x73e7, /* 0.469857 0.452759 */ +0x7441, /* 0.471392 0.454127 */ +0x749a, /* 0.472928 0.455495 */ +0x74f4, /* 0.474463 0.456861 */ +0x754d, /* 0.475999 0.458227 */ +0x75a7, /* 0.477534 0.459591 */ +0x7600, /* 0.479070 0.460954 */ +0x7659, /* 0.480605 0.462316 */ +0x76b3, /* 0.482141 0.463677 */ +0x770c, /* 0.483676 0.465037 */ +0x7765, /* 0.485212 0.466396 */ +0x77be, /* 0.486747 0.467753 */ +0x7817, /* 0.488283 0.469110 */ +0x786f, /* 0.489818 0.470465 */ +0x78c8, /* 0.491354 0.471820 */ +0x7921, /* 0.492889 0.473173 */ +0x797a, /* 0.494425 0.474525 */ +0x79d2, /* 0.495960 0.475876 */ +0x7a2b, /* 0.497496 0.477226 */ +0x7a83, /* 0.499031 0.478575 */ +0x7adb, /* 0.500567 0.479923 */ +0x7b33, /* 0.502102 0.481269 */ +0x7b8c, /* 0.503638 0.482615 */ +0x7be4, /* 0.505173 0.483959 */ +0x7c3c, /* 0.506709 0.485302 */ +0x7c94, /* 0.508244 0.486644 */ +0x7cec, /* 0.509779 0.487985 */ +0x7d43, /* 0.511315 0.489324 */ +0x7d9b, /* 0.512850 0.490663 */ +0x7df3, /* 0.514386 0.492000 */ +0x7e4a, /* 0.515921 0.493337 */ +0x7ea2, /* 0.517457 0.494672 */ +0x7ef9, /* 0.518992 0.496005 */ +0x7f51, /* 0.520528 0.497338 */ +0x7fa8, /* 0.522063 0.498670 */ +0x7fff, /* 0.523599 0.500000 */ +0x8056, /* 0.525134 0.501329 */ +0x80ad, /* 0.526670 0.502657 */ +0x8104, /* 0.528205 0.503984 */ +0x815b, /* 0.529741 0.505310 */ +0x81b2, /* 0.531276 0.506634 */ +0x8208, /* 0.532812 0.507957 */ +0x825f, /* 0.534347 0.509279 */ +0x82b6, /* 0.535883 0.510600 */ +0x830c, /* 0.537418 0.511920 */ +0x8363, /* 0.538954 0.513238 */ +0x83b9, /* 0.540489 0.514555 */ +0x840f, /* 0.542025 0.515871 */ +0x8465, /* 0.543560 0.517186 */ +0x84bb, /* 0.545096 0.518500 */ +0x8511, /* 0.546631 0.519812 */ +0x8567, /* 0.548166 0.521123 */ +0x85bd, /* 0.549702 0.522433 */ +0x8613, /* 0.551237 0.523742 */ +0x8669, /* 0.552773 0.525049 */ +0x86be, /* 0.554308 0.526355 */ +0x8714, /* 0.555844 0.527660 */ +0x8769, /* 0.557379 0.528964 */ +0x87bf, /* 0.558915 0.530266 */ +0x8814, /* 0.560450 0.531568 */ +0x8869, /* 0.561986 0.532868 */ +0x88be, /* 0.563521 0.534166 */ +0x8913, /* 0.565057 0.535464 */ +0x8968, /* 0.566592 0.536760 */ +0x89bd, /* 0.568128 0.538055 */ +0x8a12, /* 0.569663 0.539348 */ +0x8a66, /* 0.571199 0.540641 */ +0x8abb, /* 0.572734 0.541932 */ +0x8b10, /* 0.574270 0.543222 */ +0x8b64, /* 0.575805 0.544510 */ +0x8bb8, /* 0.577341 0.545798 */ +0x8c0d, /* 0.578876 0.547083 */ +0x8c61, /* 0.580412 0.548368 */ +0x8cb5, /* 0.581947 0.549652 */ +0x8d09, /* 0.583483 0.550934 */ +0x8d5d, /* 0.585018 0.552214 */ +0x8db1, /* 0.586553 0.553494 */ +0x8e04, /* 0.588089 0.554772 */ +0x8e58, /* 0.589624 0.556049 */ +0x8eac, /* 0.591160 0.557324 */ +0x8eff, /* 0.592695 0.558599 */ +0x8f53, /* 0.594231 0.559872 */ +0x8fa6, /* 0.595766 0.561143 */ +0x8ff9, /* 0.597302 0.562414 */ +0x904c, /* 0.598837 0.563682 */ +0x90a0, /* 0.600373 0.564950 */ +0x90f2, /* 0.601908 0.566216 */ +0x9145, /* 0.603444 0.567481 */ +0x9198, /* 0.604979 0.568745 */ +0x91eb, /* 0.606515 0.570007 */ +0x923e, /* 0.608050 0.571268 */ +0x9290, /* 0.609586 0.572528 */ +0x92e3, /* 0.611121 0.573786 */ +0x9335, /* 0.612657 0.575043 */ +0x9387, /* 0.614192 0.576298 */ +0x93d9, /* 0.615728 0.577553 */ +0x942c, /* 0.617263 0.578805 */ +0x947e, /* 0.618799 0.580057 */ +0x94cf, /* 0.620334 0.581307 */ +0x9521, /* 0.621870 0.582556 */ +0x9573, /* 0.623405 0.583803 */ +0x95c5, /* 0.624940 0.585049 */ +0x9616, /* 0.626476 0.586294 */ +0x9668, /* 0.628011 0.587537 */ +0x96b9, /* 0.629547 0.588779 */ +0x970a, /* 0.631082 0.590019 */ +0x975c, /* 0.632618 0.591258 */ +0x97ad, /* 0.634153 0.592496 */ +0x97fe, /* 0.635689 0.593732 */ +0x984f, /* 0.637224 0.594967 */ +0x989f, /* 0.638760 0.596200 */ +0x98f0, /* 0.640295 0.597432 */ +0x9941, /* 0.641831 0.598663 */ +0x9991, /* 0.643366 0.599892 */ +0x99e2, /* 0.644902 0.601120 */ +0x9a32, /* 0.646437 0.602346 */ +0x9a83, /* 0.647973 0.603571 */ +0x9ad3, /* 0.649508 0.604795 */ +0x9b23, /* 0.651044 0.606017 */ +0x9b73, /* 0.652579 0.607238 */ +0x9bc3, /* 0.654115 0.608457 */ +0x9c13, /* 0.655650 0.609675 */ +0x9c62, /* 0.657186 0.610891 */ +0x9cb2, /* 0.658721 0.612106 */ +0x9d01, /* 0.660257 0.613319 */ +0x9d51, /* 0.661792 0.614532 */ +0x9da0, /* 0.663327 0.615742 */ +0x9def, /* 0.664863 0.616951 */ +0x9e3f, /* 0.666398 0.618159 */ +0x9e8e, /* 0.667934 0.619365 */ +0x9edd, /* 0.669469 0.620570 */ +0x9f2b, /* 0.671005 0.621773 */ +0x9f7a, /* 0.672540 0.622975 */ +0x9fc9, /* 0.674076 0.624176 */ +0xa017, /* 0.675611 0.625374 */ +0xa066, /* 0.677147 0.626572 */ +0xa0b4, /* 0.678682 0.627768 */ +0xa103, /* 0.680218 0.628962 */ +0xa151, /* 0.681753 0.630155 */ +0xa19f, /* 0.683289 0.631347 */ +0xa1ed, /* 0.684824 0.632537 */ +0xa23b, /* 0.686360 0.633725 */ +0xa288, /* 0.687895 0.634912 */ +0xa2d6, /* 0.689431 0.636098 */ +0xa324, /* 0.690966 0.637282 */ +0xa371, /* 0.692502 0.638465 */ +0xa3bf, /* 0.694037 0.639646 */ +0xa40c, /* 0.695573 0.640825 */ +0xa459, /* 0.697108 0.642003 */ +0xa4a6, /* 0.698644 0.643180 */ +0xa4f3, /* 0.700179 0.644355 */ +0xa540, /* 0.701715 0.645528 */ +0xa58d, /* 0.703250 0.646700 */ +0xa5da, /* 0.704785 0.647870 */ +0xa626, /* 0.706321 0.649039 */ +0xa673, /* 0.707856 0.650207 */ +0xa6bf, /* 0.709392 0.651372 */ +0xa70b, /* 0.710927 0.652537 */ +0xa758, /* 0.712463 0.653700 */ +0xa7a4, /* 0.713998 0.654861 */ +0xa7f0, /* 0.715534 0.656020 */ +0xa83c, /* 0.717069 0.657179 */ +0xa887, /* 0.718605 0.658335 */ +0xa8d3, /* 0.720140 0.659490 */ +0xa91f, /* 0.721676 0.660644 */ +0xa96a, /* 0.723211 0.661795 */ +0xa9b6, /* 0.724747 0.662946 */ +0xaa01, /* 0.726282 0.664095 */ +0xaa4c, /* 0.727818 0.665242 */ +0xaa97, /* 0.729353 0.666387 */ +0xaae2, /* 0.730889 0.667532 */ +0xab2d, /* 0.732424 0.668674 */ +0xab78, /* 0.733960 0.669815 */ +0xabc2, /* 0.735495 0.670954 */ +0xac0d, /* 0.737031 0.672092 */ +0xac58, /* 0.738566 0.673228 */ +0xaca2, /* 0.740102 0.674363 */ +0xacec, /* 0.741637 0.675496 */ +0xad36, /* 0.743172 0.676627 */ +0xad80, /* 0.744708 0.677757 */ +0xadca, /* 0.746243 0.678885 */ +0xae14, /* 0.747779 0.680012 */ +0xae5e, /* 0.749314 0.681137 */ +0xaea7, /* 0.750850 0.682260 */ +0xaef1, /* 0.752385 0.683382 */ +0xaf3a, /* 0.753921 0.684502 */ +0xaf84, /* 0.755456 0.685621 */ +0xafcd, /* 0.756992 0.686738 */ +0xb016, /* 0.758527 0.687853 */ +0xb05f, /* 0.760063 0.688967 */ +0xb0a8, /* 0.761598 0.690079 */ +0xb0f1, /* 0.763134 0.691189 */ +0xb139, /* 0.764669 0.692298 */ +0xb182, /* 0.766205 0.693406 */ +0xb1ca, /* 0.767740 0.694511 */ +0xb213, /* 0.769276 0.695615 */ +0xb25b, /* 0.770811 0.696717 */ +0xb2a3, /* 0.772347 0.697818 */ +0xb2eb, /* 0.773882 0.698917 */ +0xb333, /* 0.775418 0.700014 */ +0xb37b, /* 0.776953 0.701110 */ +0xb3c2, /* 0.778489 0.702204 */ +0xb40a, /* 0.780024 0.703296 */ +0xb452, /* 0.781559 0.704387 */ +0xb499, /* 0.783095 0.705476 */ +0xb4e0, /* 0.784630 0.706564 */ +0xb527, /* 0.786166 0.707649 */ +0xb56e, /* 0.787701 0.708734 */ +0xb5b5, /* 0.789237 0.709816 */ +0xb5fc, /* 0.790772 0.710897 */ +0xb643, /* 0.792308 0.711976 */ +0xb689, /* 0.793843 0.713053 */ +0xb6d0, /* 0.795379 0.714129 */ +0xb716, /* 0.796914 0.715203 */ +0xb75d, /* 0.798450 0.716275 */ +0xb7a3, /* 0.799985 0.717346 */ +0xb7e9, /* 0.801521 0.718415 */ +0xb82f, /* 0.803056 0.719482 */ +0xb875, /* 0.804592 0.720548 */ +0xb8ba, /* 0.806127 0.721611 */ +0xb900, /* 0.807663 0.722674 */ +0xb945, /* 0.809198 0.723734 */ +0xb98b, /* 0.810734 0.724793 */ +0xb9d0, /* 0.812269 0.725850 */ +0xba15, /* 0.813805 0.726905 */ +0xba5a, /* 0.815340 0.727959 */ +0xba9f, /* 0.816876 0.729011 */ +0xbae4, /* 0.818411 0.730061 */ +0xbb29, /* 0.819946 0.731109 */ +0xbb6d, /* 0.821482 0.732156 */ +0xbbb2, /* 0.823017 0.733201 */ +0xbbf6, /* 0.824553 0.734244 */ +0xbc3a, /* 0.826088 0.735286 */ +0xbc7f, /* 0.827624 0.736326 */ +0xbcc3, /* 0.829159 0.737364 */ +0xbd07, /* 0.830695 0.738400 */ +0xbd4a, /* 0.832230 0.739435 */ +0xbd8e, /* 0.833766 0.740468 */ +0xbdd2, /* 0.835301 0.741499 */ +0xbe15, /* 0.836837 0.742528 */ +0xbe58, /* 0.838372 0.743556 */ +0xbe9c, /* 0.839908 0.744582 */ +0xbedf, /* 0.841443 0.745606 */ +0xbf22, /* 0.842979 0.746628 */ +0xbf65, /* 0.844514 0.747649 */ +0xbfa7, /* 0.846050 0.748667 */ +0xbfea, /* 0.847585 0.749684 */ +0xc02d, /* 0.849121 0.750700 */ +0xc06f, /* 0.850656 0.751713 */ +0xc0b1, /* 0.852192 0.752725 */ +0xc0f4, /* 0.853727 0.753735 */ +0xc136, /* 0.855263 0.754743 */ +0xc178, /* 0.856798 0.755750 */ +0xc1b9, /* 0.858334 0.756754 */ +0xc1fb, /* 0.859869 0.757757 */ +0xc23d, /* 0.861404 0.758758 */ +0xc27e, /* 0.862940 0.759757 */ +0xc2c0, /* 0.864475 0.760755 */ +0xc301, /* 0.866011 0.761751 */ +0xc342, /* 0.867546 0.762744 */ +0xc383, /* 0.869082 0.763737 */ +0xc3c4, /* 0.870617 0.764727 */ +0xc405, /* 0.872153 0.765715 */ +0xc445, /* 0.873688 0.766702 */ +0xc486, /* 0.875224 0.767687 */ +0xc4c6, /* 0.876759 0.768670 */ +0xc507, /* 0.878295 0.769651 */ +0xc547, /* 0.879830 0.770631 */ +0xc587, /* 0.881366 0.771608 */ +0xc5c7, /* 0.882901 0.772584 */ +0xc607, /* 0.884437 0.773558 */ +0xc646, /* 0.885972 0.774530 */ +0xc686, /* 0.887508 0.775501 */ +0xc6c5, /* 0.889043 0.776469 */ +0xc705, /* 0.890579 0.777436 */ +0xc744, /* 0.892114 0.778401 */ +0xc783, /* 0.893650 0.779364 */ +0xc7c2, /* 0.895185 0.780325 */ +0xc801, /* 0.896721 0.781284 */ +0xc840, /* 0.898256 0.782242 */ +0xc87e, /* 0.899791 0.783197 */ +0xc8bd, /* 0.901327 0.784151 */ +0xc8fb, /* 0.902862 0.785103 */ +0xc939, /* 0.904398 0.786053 */ +0xc978, /* 0.905933 0.787001 */ +0xc9b6, /* 0.907469 0.787948 */ +0xc9f4, /* 0.909004 0.788892 */ +0xca31, /* 0.910540 0.789835 */ +0xca6f, /* 0.912075 0.790776 */ +0xcaad, /* 0.913611 0.791715 */ +0xcaea, /* 0.915146 0.792652 */ +0xcb27, /* 0.916682 0.793587 */ +0xcb64, /* 0.918217 0.794520 */ +0xcba1, /* 0.919753 0.795452 */ +0xcbde, /* 0.921288 0.796381 */ +0xcc1b, /* 0.922824 0.797309 */ +0xcc58, /* 0.924359 0.798235 */ +0xcc94, /* 0.925895 0.799159 */ +0xccd1, /* 0.927430 0.800081 */ +0xcd0d, /* 0.928966 0.801001 */ +0xcd49, /* 0.930501 0.801919 */ +0xcd85, /* 0.932037 0.802836 */ +0xcdc1, /* 0.933572 0.803750 */ +0xcdfd, /* 0.935108 0.804663 */ +0xce39, /* 0.936643 0.805574 */ +0xce74, /* 0.938178 0.806482 */ +0xceb0, /* 0.939714 0.807389 */ +0xceeb, /* 0.941249 0.808294 */ +0xcf26, /* 0.942785 0.809197 */ +0xcf61, /* 0.944320 0.810099 */ +0xcf9c, /* 0.945856 0.810998 */ +0xcfd7, /* 0.947391 0.811895 */ +0xd012, /* 0.948927 0.812791 */ +0xd04c, /* 0.950462 0.813684 */ +0xd087, /* 0.951998 0.814576 */ +0xd0c1, /* 0.953533 0.815466 */ +0xd0fb, /* 0.955069 0.816353 */ +0xd135, /* 0.956604 0.817239 */ +0xd16f, /* 0.958140 0.818123 */ +0xd1a9, /* 0.959675 0.819005 */ +0xd1e3, /* 0.961211 0.819885 */ +0xd21c, /* 0.962746 0.820763 */ +0xd256, /* 0.964282 0.821640 */ +0xd28f, /* 0.965817 0.822514 */ +0xd2c8, /* 0.967353 0.823386 */ +0xd301, /* 0.968888 0.824257 */ +0xd33a, /* 0.970424 0.825125 */ +0xd373, /* 0.971959 0.825992 */ +0xd3ac, /* 0.973495 0.826856 */ +0xd3e4, /* 0.975030 0.827719 */ +0xd41c, /* 0.976565 0.828579 */ +0xd455, /* 0.978101 0.829438 */ +0xd48d, /* 0.979636 0.830295 */ +0xd4c5, /* 0.981172 0.831150 */ +0xd4fd, /* 0.982707 0.832002 */ +0xd535, /* 0.984243 0.832853 */ +0xd56c, /* 0.985778 0.833702 */ +0xd5a4, /* 0.987314 0.834549 */ +0xd5db, /* 0.988849 0.835394 */ +0xd612, /* 0.990385 0.836237 */ +0xd649, /* 0.991920 0.837078 */ +0xd680, /* 0.993456 0.837917 */ +0xd6b7, /* 0.994991 0.838754 */ +0xd6ee, /* 0.996527 0.839589 */ +0xd725, /* 0.998062 0.840422 */ +0xd75b, /* 0.999598 0.841254 */ +0xd791, /* 1.001133 0.842083 */ +0xd7c8, /* 1.002669 0.842910 */ +0xd7fe, /* 1.004204 0.843735 */ +0xd834, /* 1.005740 0.844558 */ +0xd869, /* 1.007275 0.845379 */ +0xd89f, /* 1.008811 0.846199 */ +0xd8d5, /* 1.010346 0.847016 */ +0xd90a, /* 1.011882 0.847831 */ +0xd93f, /* 1.013417 0.848644 */ +0xd975, /* 1.014952 0.849455 */ +0xd9aa, /* 1.016488 0.850265 */ +0xd9de, /* 1.018023 0.851072 */ +0xda13, /* 1.019559 0.851877 */ +0xda48, /* 1.021094 0.852680 */ +0xda7c, /* 1.022630 0.853481 */ +0xdab1, /* 1.024165 0.854281 */ +0xdae5, /* 1.025701 0.855078 */ +0xdb19, /* 1.027236 0.855873 */ +0xdb4d, /* 1.028772 0.856666 */ +0xdb81, /* 1.030307 0.857457 */ +0xdbb5, /* 1.031843 0.858246 */ +0xdbe8, /* 1.033378 0.859033 */ +0xdc1c, /* 1.034914 0.859818 */ +0xdc4f, /* 1.036449 0.860601 */ +0xdc82, /* 1.037985 0.861382 */ +0xdcb5, /* 1.039520 0.862161 */ +0xdce8, /* 1.041056 0.862938 */ +0xdd1b, /* 1.042591 0.863713 */ +0xdd4e, /* 1.044127 0.864486 */ +0xdd80, /* 1.045662 0.865257 */ +0xddb2, /* 1.047198 0.866025 */ +0xdde5, /* 1.048733 0.866792 */ +0xde17, /* 1.050269 0.867557 */ +0xde49, /* 1.051804 0.868319 */ +0xde7b, /* 1.053340 0.869080 */ +0xdeac, /* 1.054875 0.869839 */ +0xdede, /* 1.056410 0.870595 */ +0xdf0f, /* 1.057946 0.871349 */ +0xdf41, /* 1.059481 0.872102 */ +0xdf72, /* 1.061017 0.872852 */ +0xdfa3, /* 1.062552 0.873600 */ +0xdfd4, /* 1.064088 0.874347 */ +0xe005, /* 1.065623 0.875091 */ +0xe035, /* 1.067159 0.875833 */ +0xe066, /* 1.068694 0.876573 */ +0xe096, /* 1.070230 0.877311 */ +0xe0c6, /* 1.071765 0.878047 */ +0xe0f6, /* 1.073301 0.878780 */ +0xe126, /* 1.074836 0.879512 */ +0xe156, /* 1.076372 0.880242 */ +0xe186, /* 1.077907 0.880969 */ +0xe1b5, /* 1.079443 0.881695 */ +0xe1e5, /* 1.080978 0.882418 */ +0xe214, /* 1.082514 0.883140 */ +0xe243, /* 1.084049 0.883859 */ +0xe272, /* 1.085585 0.884576 */ +0xe2a1, /* 1.087120 0.885291 */ +0xe2d0, /* 1.088656 0.886004 */ +0xe2fe, /* 1.090191 0.886715 */ +0xe32d, /* 1.091727 0.887424 */ +0xe35b, /* 1.093262 0.888131 */ +0xe389, /* 1.094797 0.888835 */ +0xe3b7, /* 1.096333 0.889538 */ +0xe3e5, /* 1.097868 0.890238 */ +0xe413, /* 1.099404 0.890937 */ +0xe441, /* 1.100939 0.891633 */ +0xe46e, /* 1.102475 0.892327 */ +0xe49c, /* 1.104010 0.893019 */ +0xe4c9, /* 1.105546 0.893709 */ +0xe4f6, /* 1.107081 0.894397 */ +0xe523, /* 1.108617 0.895083 */ +0xe550, /* 1.110152 0.895766 */ +0xe57c, /* 1.111688 0.896448 */ +0xe5a9, /* 1.113223 0.897127 */ +0xe5d5, /* 1.114759 0.897805 */ +0xe601, /* 1.116294 0.898480 */ +0xe62d, /* 1.117830 0.899153 */ +0xe659, /* 1.119365 0.899824 */ +0xe685, /* 1.120901 0.900492 */ +0xe6b1, /* 1.122436 0.901159 */ +0xe6dd, /* 1.123972 0.901824 */ +0xe708, /* 1.125507 0.902486 */ +0xe733, /* 1.127043 0.903146 */ +0xe75e, /* 1.128578 0.903805 */ +0xe789, /* 1.130114 0.904461 */ +0xe7b4, /* 1.131649 0.905115 */ +0xe7df, /* 1.133184 0.905766 */ +0xe809, /* 1.134720 0.906416 */ +0xe834, /* 1.136255 0.907063 */ +0xe85e, /* 1.137791 0.907709 */ +0xe888, /* 1.139326 0.908352 */ +0xe8b2, /* 1.140862 0.908993 */ +0xe8dc, /* 1.142397 0.909632 */ +0xe906, /* 1.143933 0.910269 */ +0xe930, /* 1.145468 0.910903 */ +0xe959, /* 1.147004 0.911536 */ +0xe982, /* 1.148539 0.912166 */ +0xe9ab, /* 1.150075 0.912794 */ +0xe9d5, /* 1.151610 0.913421 */ +0xe9fd, /* 1.153146 0.914044 */ +0xea26, /* 1.154681 0.914666 */ +0xea4f, /* 1.156217 0.915286 */ +0xea77, /* 1.157752 0.915903 */ +0xeaa0, /* 1.159288 0.916518 */ +0xeac8, /* 1.160823 0.917132 */ +0xeaf0, /* 1.162359 0.917742 */ +0xeb18, /* 1.163894 0.918351 */ +0xeb3f, /* 1.165430 0.918958 */ +0xeb67, /* 1.166965 0.919562 */ +0xeb8e, /* 1.168501 0.920165 */ +0xebb6, /* 1.170036 0.920765 */ +0xebdd, /* 1.171571 0.921363 */ +0xec04, /* 1.173107 0.921958 */ +0xec2b, /* 1.174642 0.922552 */ +0xec52, /* 1.176178 0.923143 */ +0xec78, /* 1.177713 0.923733 */ +0xec9f, /* 1.179249 0.924320 */ +0xecc5, /* 1.180784 0.924905 */ +0xeceb, /* 1.182320 0.925487 */ +0xed11, /* 1.183855 0.926068 */ +0xed37, /* 1.185391 0.926646 */ +0xed5d, /* 1.186926 0.927222 */ +0xed83, /* 1.188462 0.927796 */ +0xeda8, /* 1.189997 0.928368 */ +0xedcd, /* 1.191533 0.928938 */ +0xedf3, /* 1.193068 0.929505 */ +0xee18, /* 1.194604 0.930070 */ +0xee3d, /* 1.196139 0.930633 */ +0xee61, /* 1.197675 0.931194 */ +0xee86, /* 1.199210 0.931753 */ +0xeeaa, /* 1.200746 0.932309 */ +0xeecf, /* 1.202281 0.932863 */ +0xeef3, /* 1.203817 0.933415 */ +0xef17, /* 1.205352 0.933965 */ +0xef3b, /* 1.206888 0.934513 */ +0xef5f, /* 1.208423 0.935058 */ +0xef82, /* 1.209958 0.935601 */ +0xefa6, /* 1.211494 0.936142 */ +0xefc9, /* 1.213029 0.936681 */ +0xefec, /* 1.214565 0.937218 */ +0xf00f, /* 1.216100 0.937752 */ +0xf032, /* 1.217636 0.938284 */ +0xf055, /* 1.219171 0.938814 */ +0xf077, /* 1.220707 0.939342 */ +0xf09a, /* 1.222242 0.939868 */ +0xf0bc, /* 1.223778 0.940391 */ +0xf0de, /* 1.225313 0.940912 */ +0xf100, /* 1.226849 0.941431 */ +0xf122, /* 1.228384 0.941948 */ +0xf144, /* 1.229920 0.942462 */ +0xf165, /* 1.231455 0.942974 */ +0xf187, /* 1.232991 0.943484 */ +0xf1a8, /* 1.234526 0.943992 */ +0xf1c9, /* 1.236062 0.944498 */ +0xf1ea, /* 1.237597 0.945001 */ +0xf20b, /* 1.239133 0.945502 */ +0xf22c, /* 1.240668 0.946001 */ +0xf24c, /* 1.242204 0.946497 */ +0xf26d, /* 1.243739 0.946992 */ +0xf28d, /* 1.245275 0.947484 */ +0xf2ad, /* 1.246810 0.947974 */ +0xf2cd, /* 1.248346 0.948462 */ +0xf2ed, /* 1.249881 0.948947 */ +0xf30c, /* 1.251416 0.949430 */ +0xf32c, /* 1.252952 0.949911 */ +0xf34b, /* 1.254487 0.950390 */ +0xf36b, /* 1.256023 0.950867 */ +0xf38a, /* 1.257558 0.951341 */ +0xf3a9, /* 1.259094 0.951813 */ +0xf3c7, /* 1.260629 0.952283 */ +0xf3e6, /* 1.262165 0.952750 */ +0xf404, /* 1.263700 0.953215 */ +0xf423, /* 1.265236 0.953678 */ +0xf441, /* 1.266771 0.954139 */ +0xf45f, /* 1.268307 0.954598 */ +0xf47d, /* 1.269842 0.955054 */ +0xf49b, /* 1.271378 0.955508 */ +0xf4b8, /* 1.272913 0.955960 */ +0xf4d6, /* 1.274449 0.956409 */ +0xf4f3, /* 1.275984 0.956857 */ +0xf510, /* 1.277520 0.957302 */ +0xf52d, /* 1.279055 0.957745 */ +0xf54a, /* 1.280591 0.958185 */ +0xf567, /* 1.282126 0.958623 */ +0xf583, /* 1.283662 0.959059 */ +0xf5a0, /* 1.285197 0.959493 */ +0xf5bc, /* 1.286733 0.959924 */ +0xf5d8, /* 1.288268 0.960354 */ +0xf5f4, /* 1.289803 0.960781 */ +0xf610, /* 1.291339 0.961205 */ +0xf62c, /* 1.292874 0.961628 */ +0xf647, /* 1.294410 0.962048 */ +0xf663, /* 1.295945 0.962466 */ +0xf67e, /* 1.297481 0.962881 */ +0xf699, /* 1.299016 0.963295 */ +0xf6b4, /* 1.300552 0.963706 */ +0xf6cf, /* 1.302087 0.964114 */ +0xf6e9, /* 1.303623 0.964521 */ +0xf704, /* 1.305158 0.964925 */ +0xf71e, /* 1.306694 0.965327 */ +0xf738, /* 1.308229 0.965727 */ +0xf752, /* 1.309765 0.966124 */ +0xf76c, /* 1.311300 0.966519 */ +0xf786, /* 1.312836 0.966912 */ +0xf7a0, /* 1.314371 0.967303 */ +0xf7b9, /* 1.315907 0.967691 */ +0xf7d2, /* 1.317442 0.968077 */ +0xf7ec, /* 1.318978 0.968461 */ +0xf805, /* 1.320513 0.968842 */ +0xf81d, /* 1.322049 0.969221 */ +0xf836, /* 1.323584 0.969598 */ +0xf84f, /* 1.325120 0.969973 */ +0xf867, /* 1.326655 0.970345 */ +0xf87f, /* 1.328190 0.970715 */ +0xf897, /* 1.329726 0.971083 */ +0xf8af, /* 1.331261 0.971448 */ +0xf8c7, /* 1.332797 0.971812 */ +0xf8df, /* 1.334332 0.972172 */ +0xf8f6, /* 1.335868 0.972531 */ +0xf90e, /* 1.337403 0.972887 */ +0xf925, /* 1.338939 0.973241 */ +0xf93c, /* 1.340474 0.973593 */ +0xf953, /* 1.342010 0.973942 */ +0xf96a, /* 1.343545 0.974289 */ +0xf980, /* 1.345081 0.974634 */ +0xf997, /* 1.346616 0.974977 */ +0xf9ad, /* 1.348152 0.975317 */ +0xf9c3, /* 1.349687 0.975655 */ +0xf9d9, /* 1.351223 0.975990 */ +0xf9ef, /* 1.352758 0.976324 */ +0xfa05, /* 1.354294 0.976655 */ +0xfa1a, /* 1.355829 0.976983 */ +0xfa2f, /* 1.357365 0.977310 */ +0xfa45, /* 1.358900 0.977634 */ +0xfa5a, /* 1.360436 0.977956 */ +0xfa6f, /* 1.361971 0.978275 */ +0xfa84, /* 1.363507 0.978592 */ +0xfa98, /* 1.365042 0.978907 */ +0xfaad, /* 1.366577 0.979220 */ +0xfac1, /* 1.368113 0.979530 */ +0xfad5, /* 1.369648 0.979838 */ +0xfae9, /* 1.371184 0.980144 */ +0xfafd, /* 1.372719 0.980447 */ +0xfb11, /* 1.374255 0.980748 */ +0xfb24, /* 1.375790 0.981047 */ +0xfb38, /* 1.377326 0.981343 */ +0xfb4b, /* 1.378861 0.981637 */ +0xfb5e, /* 1.380397 0.981929 */ +0xfb71, /* 1.381932 0.982218 */ +0xfb84, /* 1.383468 0.982505 */ +0xfb97, /* 1.385003 0.982790 */ +0xfba9, /* 1.386539 0.983073 */ +0xfbbc, /* 1.388074 0.983353 */ +0xfbce, /* 1.389610 0.983631 */ +0xfbe0, /* 1.391145 0.983906 */ +0xfbf2, /* 1.392681 0.984179 */ +0xfc03, /* 1.394216 0.984450 */ +0xfc15, /* 1.395752 0.984719 */ +0xfc26, /* 1.397287 0.984985 */ +0xfc38, /* 1.398823 0.985249 */ +0xfc49, /* 1.400358 0.985511 */ +0xfc5a, /* 1.401894 0.985770 */ +0xfc6b, /* 1.403429 0.986027 */ +0xfc7b, /* 1.404964 0.986281 */ +0xfc8c, /* 1.406500 0.986534 */ +0xfc9c, /* 1.408035 0.986784 */ +0xfcad, /* 1.409571 0.987031 */ +0xfcbd, /* 1.411106 0.987277 */ +0xfccd, /* 1.412642 0.987520 */ +0xfcdc, /* 1.414177 0.987760 */ +0xfcec, /* 1.415713 0.987999 */ +0xfcfb, /* 1.417248 0.988235 */ +0xfd0b, /* 1.418784 0.988468 */ +0xfd1a, /* 1.420319 0.988700 */ +0xfd29, /* 1.421855 0.988929 */ +0xfd38, /* 1.423390 0.989155 */ +0xfd47, /* 1.424926 0.989380 */ +0xfd55, /* 1.426461 0.989602 */ +0xfd63, /* 1.427997 0.989821 */ +0xfd72, /* 1.429532 0.990039 */ +0xfd80, /* 1.431068 0.990254 */ +0xfd8e, /* 1.432603 0.990467 */ +0xfd9c, /* 1.434139 0.990677 */ +0xfda9, /* 1.435674 0.990885 */ +0xfdb7, /* 1.437210 0.991091 */ +0xfdc4, /* 1.438745 0.991294 */ +0xfdd1, /* 1.440281 0.991495 */ +0xfdde, /* 1.441816 0.991694 */ +0xfdeb, /* 1.443352 0.991890 */ +0xfdf8, /* 1.444887 0.992084 */ +0xfe04, /* 1.446422 0.992276 */ +0xfe11, /* 1.447958 0.992465 */ +0xfe1d, /* 1.449493 0.992652 */ +0xfe29, /* 1.451029 0.992836 */ +0xfe35, /* 1.452564 0.993019 */ +0xfe41, /* 1.454100 0.993199 */ +0xfe4c, /* 1.455635 0.993376 */ +0xfe58, /* 1.457171 0.993552 */ +0xfe63, /* 1.458706 0.993724 */ +0xfe6e, /* 1.460242 0.993895 */ +0xfe79, /* 1.461777 0.994063 */ +0xfe84, /* 1.463313 0.994229 */ +0xfe8f, /* 1.464848 0.994393 */ +0xfe9a, /* 1.466384 0.994554 */ +0xfea4, /* 1.467919 0.994713 */ +0xfeae, /* 1.469455 0.994869 */ +0xfeb8, /* 1.470990 0.995023 */ +0xfec2, /* 1.472526 0.995175 */ +0xfecc, /* 1.474061 0.995325 */ +0xfed6, /* 1.475597 0.995472 */ +0xfedf, /* 1.477132 0.995617 */ +0xfee9, /* 1.478668 0.995759 */ +0xfef2, /* 1.480203 0.995899 */ +0xfefb, /* 1.481739 0.996037 */ +0xff04, /* 1.483274 0.996172 */ +0xff0c, /* 1.484809 0.996305 */ +0xff15, /* 1.486345 0.996436 */ +0xff1d, /* 1.487880 0.996564 */ +0xff26, /* 1.489416 0.996690 */ +0xff2e, /* 1.490951 0.996814 */ +0xff36, /* 1.492487 0.996935 */ +0xff3d, /* 1.494022 0.997054 */ +0xff45, /* 1.495558 0.997171 */ +0xff4d, /* 1.497093 0.997285 */ +0xff54, /* 1.498629 0.997397 */ +0xff5b, /* 1.500164 0.997507 */ +0xff62, /* 1.501700 0.997614 */ +0xff69, /* 1.503235 0.997719 */ +0xff70, /* 1.504771 0.997821 */ +0xff76, /* 1.506306 0.997921 */ +0xff7d, /* 1.507842 0.998019 */ +0xff83, /* 1.509377 0.998114 */ +0xff89, /* 1.510913 0.998208 */ +0xff8f, /* 1.512448 0.998298 */ +0xff95, /* 1.513984 0.998387 */ +0xff9a, /* 1.515519 0.998473 */ +0xffa0, /* 1.517055 0.998556 */ +0xffa5, /* 1.518590 0.998638 */ +0xffaa, /* 1.520126 0.998717 */ +0xffaf, /* 1.521661 0.998793 */ +0xffb4, /* 1.523196 0.998867 */ +0xffb9, /* 1.524732 0.998939 */ +0xffbe, /* 1.526267 0.999009 */ +0xffc2, /* 1.527803 0.999076 */ +0xffc6, /* 1.529338 0.999141 */ +0xffca, /* 1.530874 0.999203 */ +0xffce, /* 1.532409 0.999263 */ +0xffd2, /* 1.533945 0.999321 */ +0xffd6, /* 1.535480 0.999376 */ +0xffd9, /* 1.537016 0.999429 */ +0xffdc, /* 1.538551 0.999480 */ +0xffe0, /* 1.540087 0.999528 */ +0xffe3, /* 1.541622 0.999574 */ +0xffe5, /* 1.543158 0.999618 */ +0xffe8, /* 1.544693 0.999659 */ +0xffeb, /* 1.546229 0.999698 */ +0xffed, /* 1.547764 0.999735 */ +0xffef, /* 1.549300 0.999769 */ +0xfff1, /* 1.550835 0.999801 */ +0xfff3, /* 1.552371 0.999830 */ +0xfff5, /* 1.553906 0.999857 */ +0xfff7, /* 1.555442 0.999882 */ +0xfff8, /* 1.556977 0.999905 */ +0xfffa, /* 1.558513 0.999925 */ +0xfffb, /* 1.560048 0.999942 */ +0xfffc, /* 1.561583 0.999958 */ +0xfffd, /* 1.563119 0.999971 */ +0xfffd, /* 1.564654 0.999981 */ +0xfffe, /* 1.566190 0.999989 */ +0xfffe, /* 1.567725 0.999995 */ +0xfffe, /* 1.569261 0.999999 */ +0xfffe, /* 1.570796 1.000000 */
diff -r 000000000000 -r aa2871c4c041 stdint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stdint.h Wed Oct 20 02:20:46 2010 +0000 @@ -0,0 +1,184 @@ +/* ISO C9x 7.18 Integer types <stdint.h> + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz> + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2000-12-02 + */ + + +#ifndef _STDINT_H +#define _STDINT_H +#define __need_wint_t +#define __need_wchar_t +#include <stddef.h> + +/* 7.18.1.1 Exact-width integer types */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef long long int_least64_t; +typedef unsigned long long uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +typedef long long int_fast64_t; +typedef unsigned long long uint_fast64_t; + +/* 7.18.1.4 Integer types capable of holding object pointers */ +typedef int intptr_t; +typedef unsigned uintptr_t; + +/* 7.18.1.5 Greatest-width integer types */ +typedef long long intmax_t; +typedef unsigned long long uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ +#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 0xff /* 255U */ +#define UINT16_MAX 0xffff /* 65535U */ +#define UINT32_MAX 0xffffffff /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +#define SIZE_MAX UINT32_MAX + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0 +#define WCHAR_MAX 0xffff /* UINT16_MAX */ +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0 +#define WINT_MAX 0xffff /* UINT16_MAX */ + +#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ + + +/* 7.18.4 Macros for integer constants */ +#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn <gwyn@arl.mil>: + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." +*/ + +#define INT8_C(val) ((int8_t) + (val)) +#define UINT8_C(val) ((uint8_t) + (val##U)) +#define INT16_C(val) ((int16_t) + (val)) +#define UINT16_C(val) ((uint16_t) + (val##U)) + +#define INT32_C(val) val##L +#define UINT32_C(val) val##UL +#define INT64_C(val) val##LL +#define UINT64_C(val) val##ULL + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) INT64_C(val) +#define UINTMAX_C(val) UINT64_C(val) + +#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ + +#endif