Add method to compute the number of digits of a HYPRE_BigInt
This commit is contained in:
parent
551703ad65
commit
d508cc8a57
@ -1785,6 +1785,7 @@ void HYPRE_Finalize();
|
||||
|
||||
/* hypre_printf.c */
|
||||
// #ifdef HYPRE_BIGINT
|
||||
HYPRE_Int hypre_ndigits( HYPRE_BigInt number );
|
||||
HYPRE_Int hypre_printf( const char *format , ... );
|
||||
HYPRE_Int hypre_fprintf( FILE *stream , const char *format, ... );
|
||||
HYPRE_Int hypre_sprintf( char *s , const char *format, ... );
|
||||
|
||||
@ -116,6 +116,20 @@ free_format( char *newformat )
|
||||
return 0;
|
||||
}
|
||||
|
||||
HYPRE_Int
|
||||
hypre_ndigits( HYPRE_BigInt number )
|
||||
{
|
||||
HYPRE_Int ndigits = 0;
|
||||
|
||||
while(number)
|
||||
{
|
||||
number /= 10;
|
||||
ndigits++;
|
||||
}
|
||||
|
||||
return ndigits;
|
||||
}
|
||||
|
||||
/* printf functions */
|
||||
|
||||
HYPRE_Int
|
||||
|
||||
Loading…
Reference in New Issue
Block a user