Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #669 from joakim-hove/ERT-799
Browse files Browse the repository at this point in the history
ERT-799: Changed to use base 10 in logarithm
  • Loading branch information
joakim-hove committed Dec 16, 2014
2 parents 598efaf + c70bd0e commit a41c522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions devel/libenkf/src/gen_kw.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ void gen_kw_write_export_file(const gen_kw_type * gen_kw, FILE * filestream) {
fprintf(filestream, print_string);

if (gen_kw_config_should_use_log_scale(gen_kw->config, ikw)) {
double log_transformed_value = log(transformed_value);
const char * print_log_string = util_alloc_sprintf("LOG_%s:%s %g\n", key, parameter, width, log_transformed_value);
double log_transformed_value = log10(transformed_value);
const char * print_log_string = util_alloc_sprintf("LOG10_%s:%s %g\n", key, parameter, width, log_transformed_value);
fprintf(filestream, print_log_string);
}
}
Expand Down
2 changes: 1 addition & 1 deletion devel/libenkf/tests/gen_kw_logarithmic_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void test_write_gen_kw_export_file(enkf_main_type * enkf_main)
double value = stringlist_iget_as_double(token_list, 5, NULL);

test_assert_true(value > 0.0); //Verify precision
test_assert_true(NULL != strstr(file_content, "LOG_")); //Verify log entry
test_assert_true(NULL != strstr(file_content, "LOG10_")); //Verify log entry

stringlist_free(token_list);
free(file_content);
Expand Down

0 comments on commit a41c522

Please sign in to comment.