/*
 * Copyright (c) 2009 Veselin Georgiev
 *
 * Cutting the bullshit:
 *  all sources here are free software; you can use them for everything you
 *  want. Just don't blame me if something goes wrong; if something happens
 *  (including, but not limited to:
 *     coredumps, formatted harddrives, ping timeouts, winamp sound skips,
 *     fried CPUs, sudden mother-in-law visits, fraglimits, viagra spam,
 *     barking dogs, earthquakes, frog rain, Windows Vista installations,
 *     anrieff playing the bass guitar, dangerous sporks, apocalypse,
 *     concrete donkey, or even Chuck Norris getting your butt kicked...
 *  ), then you know you have been warned. Four times.
 *
 * Btw, Chuck Norris now doesn't code neither Python, nor Ruby. He's hacking
 * with Makefiles.
 */
#ifndef __UTILS_H__
#define __UTILS_H__

template <typename T> inline T sqr(T x) { return x*x; }
template <typename T> inline T abs(T x) { return x < T(0) ? -x : x; }

#define round(x) (floor(x+0.5))
#ifndef M_PI
#	define M_PI 3.14159265358979323
#endif
#define COUNT_OF(x) (sizeof(x) / sizeof(x[0]))

#endif // __UTILS_H__
