- Feature Articles
- CodeSOD
- Error'd
- 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
Admin
What he said was wrong.
You can't get rounding errors with decimal types. Essentially they are exactly the same as storing tenths, hundredths etc but the field in the database knows how many decimal places it has. So you don't have to multiply/divide in your own code and you can add extra decimal places and you don't need to convert the data.
Floating point numbers do suffer from rounding errors and shouldn't ever be used if you need accurate results
Admin
Happy Birthday Nathan!
:)
Admin
A thousand year old Chinese guy?
Admin
He probably still uses waterfall.
Admin
Admin
Admin
Admin
Admin
Sigh, can we please stop this trend of waiting until late afternoon to post an article?
Admin
Yes... please make sure that new articles are posted by 09:00 GMT each weekday!
Admin
Admin
Admin
FTFTFYFY, and now we've come full circle.
Admin
when it comes to futures trading and financial flim-flam, it's better to just let the code be a failure.
It's a laudable goal to work towards putting food on the table, but not when it's a contribution to economic destruction. The person writing the code has more at stake and more to lose than the benefactors of such a BS leaky financial suction pump.
Admin
^This. Suddenly the introduction
makes more sense!Admin
That is... Amazing
Admin
Long life to the Computer.
Admin
Man, have you ever seen some inflation in africa. Lucky they dont have money to use information systems. They burn money to heat because its cheaper to use money cedules instead of wood.
Admin
FTFY
Admin
Admin
Its true, the real WTF is that people think it is always correct to store money in decimal format. It IS VERY common that storing in integer format is best. It is associated with how banks and accountants reconcile accounts.
ie $1 divided by three in the real world is $0.33c $1 divided by three when stored as an integer works too, ie 100c/3=33c $1 divided by three in decimal is $0.3333...
These summ the errors over time and your software using decimal maths will be declared broken by any competent accountant!!!
Admin
What? DECIMAL is a completely useless datatype! Everyone knows that non-integer numbers cannot be stored precisely by computers; you get... err... fuzzy bits!
Admin
Decimal has good uses, just not for money. It sounds like a good idea until you work out that you cant do money math with decimal
Admin
There's an answer for management who won't allow a rewrite where one is clearly needed: go on strike. Tell them: "You know what? No. I'm not gonna port this code, because once I do, it's gonna have my name on it. And I refuse to put my name on what I know is a buggy piece of shit. You want it ported? You port it. Then you can put your name on it."
It works best when there are multiple team members who feel the same way. Same speach, just with plural possessives. I find the "won't-compromise-my-reputation" speech gets better results than dispassionate logic. Show that you really CARE, and win the day.
But bring your resume up-to-date first, just in case.