Hi!

9-Мар-2004 23:55 [EMAIL PROTECTED] (Michael Devore) wrote to
[EMAIL PROTECTED]:

>>I'm thinking pmem[2] / 2 + 1 would be better in case ever a 0ffh byte value was 
>>encountered.  Or else cast pmem[2]to an unsigned int before the calculations.   Or 
>>does a EPROM running to size 127.5K even exist on PCs?
MD> Yes, I am an idiot.  I should have said (pmem[2] - 1) / 2 + 1.  That cast is
MD> looking better.

     This is valid expression:

divroundup(x,y) = (x+y-1)/y = (x-1)/y+1

but you should be sure that x can't be zero before rounding.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Freedos-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to