Skip to content

Commit

Permalink
verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
oguyon committed Jun 26, 2024
1 parent e76d08a commit 3ef336d
Showing 1 changed file with 54 additions and 49 deletions.
103 changes: 54 additions & 49 deletions src/COREMOD_arith/execute_arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,40 +366,17 @@ int execute_arith(const char *cmd1)
switch(cmd[i])
{

case '+':
case '-':
if((i>1) &&((cmd[i - 1] == 'e') || (cmd[i - 1] == 'E')) &&
(isdigit(cmd[i - 2])) && (isdigit(cmd[i + 1])))
{
// + or - is part of exponent
word[w][l] = cmd[i];
l++;
}
else
{
if(l > 0)
{
word[w][l] = '\0';
w++;
}
l = 0;
word[w][l] = cmd[i];
word[w][1] = '\0';
if(i < (signed)(strlen(cmd) - 1))
{
w++;
}
l = 0;
}
break;

case '*':
case '/':
case '^':
case '(':
case ')':
case '=':
case ',':
case '+':
case '-':
if((i>1) &&((cmd[i - 1] == 'e') || (cmd[i - 1] == 'E')) &&
(isdigit(cmd[i - 2])) && (isdigit(cmd[i + 1])))
{
// + or - is part of exponent
word[w][l] = cmd[i];
l++;
}
else
{
if(l > 0)
{
word[w][l] = '\0';
Expand All @@ -413,22 +390,45 @@ int execute_arith(const char *cmd1)
w++;
}
l = 0;
break;

case ' ':
}
break;

case '*':
case '/':
case '^':
case '(':
case ')':
case '=':
case ',':
if(l > 0)
{
word[w][l] = '\0';
w++;
l = 0;

/*word[w][l] = '\0';
w++;
l = 0;*/
break;

default:
word[w][l] = cmd[i];
l++;
break;
}
l = 0;
word[w][l] = cmd[i];
word[w][1] = '\0';
if(i < (signed)(strlen(cmd) - 1))
{
w++;
}
l = 0;
break;

case ' ':
word[w][l] = '\0';
w++;
l = 0;

/*word[w][l] = '\0';
w++;
l = 0;*/
break;

default:
word[w][l] = cmd[i];
l++;
break;
}
}

Expand Down Expand Up @@ -1954,7 +1954,12 @@ int execute_arith(const char *cmd1)
}
else
{
printf("Running percentile args = %s %f\n",word[i+2],data.variable[variable_ID(word[i+4])].value.f);
printf("Running percentile args = %s %f\n",
word[highest_priority_index + 2],
(double) data.variable[variable_ID(word[highest_priority_index + 4])].value.f
);


tmp_prec = arith_image_percentile(
word[highest_priority_index + 2],
(double) data
Expand Down

0 comments on commit 3ef336d

Please sign in to comment.