Re: Act.informative.c

From: Eric L. Helvey (helver@newwave.net)
Date: 07/23/96


You're doing a float operation on two ints...  they don't like that.
if you try to divide an int by an int, the result is an int.  If the char's
max hit is less than 50, the result is a 0.  Then you take this 0, and 
divide by it...  hence your arithmetic exception.  Best way to do it is
to either cast the result of the first division as a float, or perhaps to
use 50.0 instead of just 50 for initial divide...

I think that should work...

Helver

On Tue, 23 Jul 1996, Adam Days wrote:

> Okay I went with Christopher's idea.  Now I have a new problem with it.
> (or old I guess.).  When I went and tested it with a new character and
> went in and typed score, it crashed and gave me an "Arithmetic Exception"
> error.  what gives?
> These are the three things I'm using for the life bar.
> GET_HPR(ch) = (GET_MAX_HIT(ch) / 50)
> then,
> ASTERISK(ch) = (GET_HIT(ch) / GET_HPR(ch))
> Now shouldn't those work?
> Why wouuld a lower level character make it crash, is it because of their
> lower hit points?
> *******************************************************************************
>  Adam Days  a.k.a		  ** "Being an Outcast is only a frame of mind
>  Drizzt Do'Urden                  **  and not something that is placed upon
>  Unholy Lands <164.116.34.2 4000> **  you."  -Adam Days
> *******************************************************************************
> 
> 



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