summaryrefslogtreecommitdiff
path: root/src/core/math_func.hpp
AgeCommit message (Collapse)Author
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-08-31Codechange: math functions - use cpp-style castsNikolas Nyby
2019-03-28Fix: MSVC warnings (#7423)glx22
2019-01-20Fix: Round up deltas for smooth scrolling, so target will be reachedbtzy
2014-06-17(svn r26651) -Fix: make sure an abs is used that supports int64 when using ↵rubidium
abs on those variables
2013-06-09(svn r25347) -Add: function for deterministic approximate divisionfonsinchen
2011-12-20(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the ↵truebrain
others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
2011-12-09(svn r23466) -Fix [FS#4871, FS#4874]: assertion triggered when resizing a ↵rubidium
window during ReInit by an amount that's not a multiple of the resize interval
2011-12-03(svn r23415) -Feature: Infrastructure maintenance costs.michi_cc
2010-04-18(svn r19671) -Fix (r19670): RoundDiv() needs to deal with signed numerators.frosch
2010-04-18(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer ↵frosch
divisions with rounding.
2010-04-12(svn r19614) -Codechange: "it's" => "its" where appropriatesmatz
2009-12-15(svn r18508) -Fix [FS#3372]: if a rail station class had less data than ↵rubidium
capacity it would try to set a negative position
2009-12-09(svn r18443) -Fix (r18438): MSVC thinks, in it's infinite wisdom, that int ↵rubidium
min(int, int) is a better match for min(uint64, uint) than uint64 min(uint64, uint64). As such we need to cast the UINT16_MAX to prevent MSVC from displaying it's infinite wisdom with loads of warnings.
2009-12-09(svn r18438) -Codechange [FS#3337]: introduce a template for Clamp ↵rubidium
(fonsinchen) and reuse template functions in their non-template counterparts.
2009-09-19(svn r17570) -Fix: a number of Doxygen warnings about missing parameters, ↵rubidium
which were sometimes missing and sometimes just typos
2009-08-27(svn r17292) -Codechange: use unified ToPercent() function to convert fract ↵smatz
numbers to percents
2009-08-21(svn r17248) -Fix: add GPL license notice where appropriaterubidium
2009-07-01(svn r16715) -Codechange: add attribute to assert_compile(), so it doesn't ↵smatz
warn when used inside function
2009-03-21(svn r15777) -Add: helper functions to get the least common multiple and the ↵rubidium
greatest common divisor (Alberth)
2008-06-26(svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and ↵smatz
encoding so it uses similiar scheme as 8bpp-optimized All zoom levels are stored and a kind of RLE is used. Together with further changes and reducing number of variables, drawing is ~50% faster in average.
2008-06-22(svn r13607) -Fix (r13606): some coding style issues got fixed but some ↵skidd13
got/stayed broken
2008-06-22(svn r13606) -Codechange: use "static FORCEINLINE" where possible as default ↵skidd13
for core functions (big functions use just inline instead)
2008-04-04(svn r12573) -Codechange: use defined constants instead of numbers in ↵smatz
math_func.hpp
2008-04-04(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit ↵smatz
values didn't work
2008-03-27(svn r12438) -Fix-ish: typo spotted by Biblo.rubidium
2008-02-20(svn r12204) -Fix (r12192): using UINT16_MAX broke compilation on many targetssmatz
2008-02-20(svn r12192) -Fix: clamp various town variables to 16bit prior to returning ↵smatz
the value
2007-12-25(svn r11691) -Codechange: move+rename helpers.hpp and only include it when ↵rubidium
it is really needed.
2007-12-23(svn r11684) -Codechange: split gfx.h in a type and functional header.rubidium
2007-12-21(svn r11674) -Codechange: refactor some functions out of macros.h into more ↵rubidium
logical locations.
2007-12-17(svn r11652) -Codechange: add the svn $ header for several filessmatz
2007-11-26(svn r11526) -Codechange: Rename the function delta fitting to the naming styleskidd13
2007-11-24(svn r11510) -Codechange: merge the IS_*INSIDE* functions and rename them ↵skidd13
fitting to the naming style
2007-11-22(svn r11490) -Codechange: Split the math functions to their own headerskidd13
-Codechange: Replace the rest of the math macros with functions