Re: [Stupid newbie coder] Question

From: Nuku Nuku (backdoor@wam.umd.edu)
Date: 05/22/96


> 
> > > >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...

I got it to work!:)   Thanks everyone:)  Casting it as a float iss what i 
needed to do.

Pirahna
RanmaMUD



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