Re: [Stupid newbie coder] Question

From: Al Figliolia (alfig@accessnv.com)
Date: 05/21/96


On Tue, 21 May 1996, Nuku Nuku wrote:

> > >xp_percent = GET_EXP(ch) / titles[(int) GET_CLASS(ch)][GET_LEVEL(ch)+1].exp;
> > >
> > >                         
> > >xp_percent should be the approx, percentage of xp the character has 
> > >gotten for his next level.  I've gotten all sorts of errors, done all 
> > 
> > Percent of 'a' in 'b' is:   100 * a / b
> > 
> > >sorts of fixes, but for some reason, i always get < .1
> > 
> > That's because you need to multiply the result by 100 :)
> 
> hehe, i KNOW that much:)  In my code, i check for .1, .2, .3, etc.
> 

Are you defining xp_percent as an int? If so, then since it will always 
result in a number less than 1 it will be rounded to 0 which would 
explain why it is always a number less than < .1...

Al Figliolia - Implementor and Coder for the siteless Crimson Realms.
- Anyone out there have a spare mud site? If so, email alfig@accessnv.com.



This archive was generated by hypermail 2b30 : 12/18/00 PST