gams:precision_of_data_within_gams

This shows you the differences between two versions of the page.

Both sides previous revision Previous revision | |||

gams:precision_of_data_within_gams [2008/02/07 06:25] Franz Nelissen |
gams:precision_of_data_within_gams [2021/03/16 04:16] (current) Steven Dirkse |
||
---|---|---|---|

Line 6: | Line 6: | ||

There is also limit to the precision of these doubles - the relative error between any real number in the normalized range and the nearest representable double is at most 2.2204e-016. In practice this means values will have at most 15 or 16 decimal digits of accuracy. GAMS will never print more than 15 decimals. When GAMS reads numbers it will guarantee 15 digits of precision and will give an error message ($103) when getting a number with more than 16 digits, since there will be a loss of precision in storing the result and the extra digits are essentially meaningless: | There is also limit to the precision of these doubles - the relative error between any real number in the normalized range and the nearest representable double is at most 2.2204e-016. In practice this means values will have at most 15 or 16 decimal digits of accuracy. GAMS will never print more than 15 decimals. When GAMS reads numbers it will guarantee 15 digits of precision and will give an error message ($103) when getting a number with more than 16 digits, since there will be a loss of precision in storing the result and the extra digits are essentially meaningless: | ||

* The option $offdigit can be used to read in data which has more than 16 digits | * The option $offdigit can be used to read in data which has more than 16 digits | ||

- | * The ''display'' statement only prints up to 8 decimals (3 by default) to the listing file. Use the option ''decimals = n'' to change it the n decimals. | + | * The ''display'' statement only prints up to 8 decimals (3 by default) to the listing file. Use the option ''decimals = n'' to change it to n decimals. |

* To get maximal precision on a put statement one should force 'scientific' format with plenty of room as shown below | * To get maximal precision on a put statement one should force 'scientific' format with plenty of room as shown below | ||

- | * GDX in and out does not drop any precision, it takes the floating point number bit by bit. | + | * GDX in and out does not drop any precision, it takes the floating point number bit by bit. |

<code> | <code> | ||

$eolcom # | $eolcom # |

IMPRESSUM / LEGAL NOTICE
PRIVACY POLICY
gams/precision_of_data_within_gams.1202361939.txt.gz ยท Last modified: 2008/02/07 06:25 by Franz Nelissen