Changeset 763


Ignore:
Timestamp:
03/28/18 02:28:11 (6 years ago)
Author:
Maciej Komosinski
Message:

Higher precision when storing variable values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fn/conv_fn.cpp

    r757 r763  
    88GenoConv_fn0::GenoConv_fn0()
    99{
    10         name = "Vector of real values, no phenotype"; //for numerical optimization; custom fitness function must be provided in script
     10        name = "Vector of real values, no phenotype"; //for numerical optimization; custom fitness function must be provided in script. See oper_fn.cpp for more details.
    1111        in_format = 'n';
    1212        out_format = '0';
     
    7676                if (i > 0)
    7777                        out += ", ";
    78                 snprintf(buffer, sizeof(buffer), "%g", vec[i]);
    79                 out += buffer; //+= std::to_string(1.23) not available in embarcadero 10.2
     78                snprintf(buffer, sizeof(buffer), "%.8g", vec[i]);
     79                out += buffer; //+= std::to_string(1.23) still not available in embarcadero 10.2.3
    8080        }
    8181        return out + "]";
Note: See TracChangeset for help on using the changeset viewer.