IBBM 2017

Results 1 to 3 of 3

Thread: Precision of logfile floats

  1. #1

    Default Precision of logfile floats

    Hello,

    I am writing a logfile in FEBio that I use further in the processing. However, with the default precision of 6 decimal points I run into truncation error for my wrapper routine. Is there a way to increase the number of decimal points in the logfile? I tried adding,

    format='%i %.10g'

    however, that just printed .10g instead of the reaction forces that want. Any ideas on how to achieve this will be much appreciated.

    Thanks in advance!
    Ankush.

  2. #2
    Join Date
    Jul 2015
    Posts
    11

    Default

    I would also like to be able to specify a precision and was wondering if there was an update on this.

    Thanks!

    Stephen

  3. #3

    Default

    Hi Stephen,

    I modified the source code. In FECore/DataStore.cpp I changed the lines (in FEBio 2.4; the changes might be different in different versions)

    fprintf(fp, "%lg", val);

    to

    fprintf(fp, "%.16lg", val);

    This increased the precision to 16 decimal places. Hope this helps.

    Bets,
    Ankush.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •