- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Secret Horror
- Not Impossible
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
-Frist
Edit Admin
I'm glad that when I work with hardware like that, I can use Python and libraries that handle this stuff for me.
Edit Admin
And of course UInt16, no matter how you capitalise it, is the wrong internal data type for five-digit numbers anyway.
Admin
W.r.t. rounding errors, they would probably have been better off inserting a decimal point/adding trailing zeroes in the value string before parsing as a double.
Edit Admin
I also like the function name vs signature:
public double ConvertIntToDecimal(...
Given that the language has numeric types called both
double
anddecimal
how about the name itpublic double ConvertIntToDouble(...
Or better yetpublic double ConvertIntWithFractionToDouble(...
Or even better, create an object /struct that captures the two string values and exposes the value as a double (and/or a true decimal)
Edit Admin
" they're mistake is an easy mistake to make " I was so sure this was a clue.
Edit Admin
Isn't a big chunk of the WTF here is on Janet's company? How did they pay the contractors and release them from the contract before actually checking if what they wrote worked at all? I admit I haven't worked myself with the kind of HPCs that do one project and skitter off, but that seems really financially irresponsible.
Edit Admin
Fixed point arithmetics, pretty common in the embedded world.
Admin
They're mistake? Seriously?