Hi All,
I am working on conversions between different geographical coordinate systems that require a very high degree of precision of at least 8 decimal places. Of course, at that level, rounding errors are a major factor. For example, 1.00000000 * 3600 converts to 0.00027778 and then back to 1.00000000. Of course, the conversion back to 1 never really equals one due to rounding errors it equals 1.000008. There are some algorithms that deal with this problem such as the Kahn Summation Algorithm but I was wondering if .net (VB in particular) has any methods to deal with this problem directly? Maybe there is some technique that I am not aware of such as setting some parameter for the double or decimal type or something?
I tried using the decimal type which gives me the same answer as double which includes the 0.000008 and played around with the decimal.round function to no avail. Any suggestions?
I am working on conversions between different geographical coordinate systems that require a very high degree of precision of at least 8 decimal places. Of course, at that level, rounding errors are a major factor. For example, 1.00000000 * 3600 converts to 0.00027778 and then back to 1.00000000. Of course, the conversion back to 1 never really equals one due to rounding errors it equals 1.000008. There are some algorithms that deal with this problem such as the Kahn Summation Algorithm but I was wondering if .net (VB in particular) has any methods to deal with this problem directly? Maybe there is some technique that I am not aware of such as setting some parameter for the double or decimal type or something?
I tried using the decimal type which gives me the same answer as double which includes the 0.000008 and played around with the decimal.round function to no avail. Any suggestions?