You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
46 lines
1.0 KiB
2 years ago
|
/*
|
||
|
* Copyright(C) 1999-2020 National Technology & Engineering Solutions
|
||
|
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
|
||
|
* NTESS, the U.S. Government retains certain rights in this software.
|
||
|
*
|
||
|
* See packages/seacas/LICENSE for details
|
||
|
*/
|
||
|
|
||
|
#include <math.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
/* Print a double precision number with filtering format to screen. */
|
||
|
void doubleout(double number, int mode)
|
||
|
/* argument to print */
|
||
|
/* currently just one */
|
||
|
{
|
||
|
if (mode == 1) {
|
||
|
if (fabs(number) < 100) {
|
||
|
printf(" %19.16f", number);
|
||
|
}
|
||
|
else {
|
||
|
printf(" %19g", number);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* Print a double precision number with filtering format to file. */
|
||
|
void doubleout_file(FILE *outfile, double number, int mode)
|
||
|
/* output file if not NULL */
|
||
|
/* argument to print */
|
||
|
/* currently just one */
|
||
|
{
|
||
|
if (outfile == NULL) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (mode == 1) {
|
||
|
if (fabs(number) < 100) {
|
||
|
fprintf(outfile, " %19.16f", number);
|
||
|
}
|
||
|
else {
|
||
|
fprintf(outfile, " %19g", number);
|
||
|
}
|
||
|
}
|
||
|
}
|