On Thu, 17 Aug 2000, Blaize wrote:
> This is actually the first thing I modified source code wise, back when I
> knew
> very little about coding.
You sure that isn't still the case?
> At first I used 2^(GET_LEVEL(ch)-1) * 2000
> resulting in
> 1:2000
> 2:4000
> 3:8000
> 4:16000
> 5:32000
> ...
> 30:214748364800 Incedently this is the maximum auction bid on a MUD called
> Phidar (phidar.com 9000)
2 to the 29th * 2000 would be 1073741824000; significantly out of the
range of a signed signed integer of 8 bytes [4294967296]; hence the
value would overflow and exhibit undefined behavior.
..
Actually that's not what you get... you end up with
8002 at level 5 and 62002 at level 30 based on that C expression.
While in some other languages and in simple speak ^ is used for
exponents, in C and C++ as well, the ^ operator is not for
exponents, it's for returning the result of a XOR of the bits in a value
with those in another value; pow(), a function call, is used to raise
values to powers [when the object code is linked with the appropriate
libraries].
-Mysid
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 04/11/01 PDT