ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.112 by root, Tue Jul 6 20:15:13 2010 UTC vs.
Revision 1.114 by root, Sat Apr 23 04:56:51 2011 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 5 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 6 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 7 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 9 * option) any later version.
114 114
115// sign0 returns -1, 0 or +1 115// sign0 returns -1, 0 or +1
116template<typename T> 116template<typename T>
117static inline T sign0 (T v) { return v ? sign (v) : 0; } 117static inline T sign0 (T v) { return v ? sign (v) : 0; }
118 118
119//clashes with C++0x
119template<typename T, typename U> 120template<typename T, typename U>
120static inline T copysign (T a, U b) { return a > 0 ? b : -b; } 121static inline T copysign (T a, U b) { return a > 0 ? b : -b; }
121 122
122// div* only work correctly for div > 0 123// div* only work correctly for div > 0
123// div, with correct rounding (< 0.5 downwards, >=0.5 upwards) 124// div, with correct rounding (< 0.5 downwards, >=0.5 upwards)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines