gams:precision_of_data_within_gams

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

gams:precision_of_data_within_gams [2007/08/17 14:22] 127.0.0.1 external edit |
gams:precision_of_data_within_gams [2008/02/07 06:25] Franz Nelissen |
||
---|---|---|---|

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 listing file only prints up to 8 decimals (3 by default) | + | * 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. |

* 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. |

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