I have to generate numbers in range [-100; +2000] in c++. How can I do this with rand if there is only positive numbers available? Are there any fast ways?<
In C++0x they will enhance this to provide better support for it with a standard library.
http://www2.research.att.com/~bs/C++0xFAQ.html#std-random