зеркало из https://github.com/github/ruby.git
46 строки
981 B
C
46 строки
981 B
C
|
/*
|
|||
|
* PROJECT C Library, X68000 PROGRAMMING INTERFACE DEFINITION
|
|||
|
* --------------------------------------------------------------------
|
|||
|
* This file is written by the Project C Library Group, and completely
|
|||
|
* in public domain. You can freely use, copy, modify, and redistribute
|
|||
|
* the whole contents, without this notice.
|
|||
|
* --------------------------------------------------------------------
|
|||
|
* $Id$
|
|||
|
*/
|
|||
|
/* changed 1997.2.2 by K.Okabe */
|
|||
|
|
|||
|
/* System headers */
|
|||
|
#include <stdlib.h>
|
|||
|
#include <sys/xstdlib.h>
|
|||
|
|
|||
|
/* Functions */
|
|||
|
int _round (char *top, char *cur, int undig)
|
|||
|
{
|
|||
|
char *ptr;
|
|||
|
|
|||
|
/* <20>Ǹ夬5̤<35><CCA4><EFBFBD>ʤ<EFBFBD><CAA4>ݤ<EFBFBD><DDA4><EFBFBD>ɬ<EFBFBD>פʤ<D7A4> */
|
|||
|
if (undig < '5')
|
|||
|
return 0;
|
|||
|
|
|||
|
/* <20>ݥ<EFBFBD><DDA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
ptr = cur - 1;
|
|||
|
|
|||
|
/* <20><>Ƭ<EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>ݤ<EFBFBD><DDA4><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
while (ptr >= top) {
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>夬<EFBFBD><E5A4AC><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if (++(*ptr) <= '9')
|
|||
|
return 0;
|
|||
|
|
|||
|
/* <20><><EFBFBD>η<EFBFBD><CEB7><EFBFBD>0<EFBFBD><30><EFBFBD>᤹ */
|
|||
|
*ptr-- = '0';
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
/* <20><>Ƭ<EFBFBD><C6AC>1<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD> */
|
|||
|
*++ptr = '1';
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>夬<EFBFBD><E5A4AC><EFBFBD>餻<F2A4B7A4><E9A4BB> */
|
|||
|
return 1;
|
|||
|
}
|