guides:common_coding_errors_payload_testing
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
guides:common_coding_errors_payload_testing [2012/10/09 18:32] – danielrichman | guides:common_coding_errors_payload_testing [2012/10/09 18:54] (current) – [Prime Meridian] danielrichman | ||
---|---|---|---|
Line 91: | Line 91: | ||
<code c>long i2 = labs(lround((lon - i1) * 1000000)); // == 1234</ | <code c>long i2 = labs(lround((lon - i1) * 1000000)); // == 1234</ | ||
+ | |||
+ | There' | ||
+ | |||
+ | The intention is the above code is that the integer part will supply the negative sign if required. However, consider -0.7. i1 would be -0, but -0 == 0, and the result would be " | ||
+ | |||
+ | <code c> | ||
+ | |||
==== Equatorial ==== | ==== Equatorial ==== | ||
Line 107: | Line 114: | ||
int i1 = what; | int i1 = what; | ||
long i2 = labs(lround((what - i1) * 1000000)); | long i2 = labs(lround((what - i1) * 1000000)); | ||
- | + | ||
- | snprintf(where, | + | snprintf(where, |
} | } | ||
guides/common_coding_errors_payload_testing.1349807558.txt.gz · Last modified: 2012/10/09 18:32 (external edit)