Re: percentile

From: Daniel Koepke (dkoepke@california.com)
Date: 02/07/97


On Fri, 7 Feb 1997, Brian Williams - Nashak wrote:

> question... would
> int percent = (GET_HIT(victim) / dam) * 100;
> always return 100?
> I want it so that it'll go into decimals for the division, and then
> * 100 would be the percent of hp you do in damage.. thanks for
> a response =) 

Integers in C don't permit decimals.  So:

  (25 / 2) * 100

Will equal (12.5) * 100, and finally 1200.  That's probably not the
desired result, no?


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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