Author: Sune Fischer
Date: 08:12:22 12/07/01
Go up one level in this thread
Wups, reverse that, the logic was bad before.
char *PrintInt64(long64 x, char *s)
{
int MEGA=1000000;
long64 a = x/((long64) MEGA);
long64 b = x%((long64) MEGA);
if (a==0)
{
sprintf(s,"%d",b);
return(s);
}
if (b<MEGA/100000) sprintf(s,"%d00000%d",a,b);
else if (b<MEGA/10000) sprintf(s,"%d0000%d",a,b);
else if (b<MEGA/1000) sprintf(s,"%d000%d",a,b);
else if (b<MEGA/100) sprintf(s,"%d00%d",a,b);
else if (b<MEGA/10) sprintf(s,"%d0%d",a,b);
else if (b>=MEGA/10) sprintf(s,"%d%d",a,b);
else sprintf(s,"Error in PrintInt64");
return(s);
}
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.