- 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
My chemist fiancee explained it. It's not interesting.
Admin
I'm honestly surprised that SELECT 0.57*100 in T-SQL doesn't produce 100.
Admin
I've been sent screen shots as giant bitmaps, PNGs, PDFs, Word docs, Powerpoint presentations, I think I even had one pasted into an Excel spreadsheet. Users are funny.
Admin
Admin
It doesn't manner.
Admin
Regarding the bug report that reads as if it was written by a drunk schizophrenic - could it be George from The Chronicles of George is still alive and working in the IT industry? It must be him - how could more than one person like that exist on planet earth?
Admin
I guess there are only a few of us that have written Red Bull-fueled emails at 4am after working for 37 consecutive hours of that nature.
Admin
819.80085
Admin
Admin
I guess John didn't add them to his Buddy List, so he shouldn't complain when he gets the less effective version.
Admin
Bad English??
No, probably someone who is channeling Yoda, or does WAY too much FORTH.
As for Wells Fargo, they seem to want their emails confirmed, so they include "bugs" in them. Unfortunately, my email client doesn't do these things, and I keep seeing the "your email address is wrong" when I go about my online banking. Maybe they will wake up someday about this. Otherwise their web site is one of the best. Not loaded with silly graphics (that take time) or much Javascript (which takes even more time).
Admin
Please don't frisk the comments.
Admin
Not to mention this strange business of multiplying <1 values by 100, such that sending "57" instead of "0.57" should be considered an equivalent operation that circumvents the "bug". It's hard to follow just what they're trying to do there...
Admin
Admin
But why are they biq?
Admin
that is, it is not untrue to state that Java math is giving an incorrect result - and note also that he says "a java math error" not "a java.math error" which I think adds some ambiguity anyway)
Admin
TRWTF is that Rick is getting John's email.
Admin
It's on par with Belg**m.
Admin
yep, Groovy does this by default for example:
def num = 0.57 assert 0.57 * 100 == 57 assert num.class == java.math.BigDecimal
Admin
I disagree. It's not a "java math" problem, because java math provides a way to prevent the problem. The problem only reared it's head because the coder chose to use a floating point.
If this was a financial application and that "bug" ended up costing the company millions of dollars, would you be OK with him blaming it on Java? I doubt it.
Admin
I actively encourage my clients to paste their screenshots into Word. Why? Because when you do that, Word preserves the scaling information and I can blow it up and see the thing they are trying to point out.
The alternative is that I get a screenshot of a full size window on a 24" monitor embedded into an email message using Outlook. Outlook doesn't preserve the scaling info and it's impossible to see the tiny message.
So apologies for creating a user base that does screenshots with Word, but it really is a useful tool. It's speedy to do and it uses tools the client is mostly familiar with. I do sometimes manage to teach them how to take a screenshot of the "active" window, but I'm happy enough to get a peek at the error message if it's legible.
Admin
Those are two separate issues. It's a Java math problem, but it's a known Java math problem. So the coder would be at fault for not being aware of something that just about every developer knows is broken.
Admin
Very good point. I wasn't trying to say all of those formats are wrong, just that there is a wide variety that they come in.
Admin
Let's look at it another way.... does 0.57 * 100 = 56.9999999? does 0.57 * 100.0 = 56.9999999?
If you claim that they don't then it's an error. If you claim that they do then you're the error.
Of course, it's a well known error so people should avoid it, but it's an error nonetheless (in fact the behaviour is even documented).
slightly aside, but I'd say this recommendation (by oracle) would absolve them from any issues caused by their error: float: The float data type is a single-precision 32-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in the Floating-Point Types, Formats, and Values section of the Java Language Specification. As with the recommendations for byte and short, use a float (instead of double) if you need to save memory in large arrays of floating point numbers. This data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead. Numbers and Strings covers BigDecimal and other useful classes provided by the Java platform.
Admin
Very true.
Of course anything beats having a client email a phone photo to my very, very dumb phone which can barely handle SMS text messages. Killing that off without running down all my minutes is fun. Nonetheless I do appreciate the client's effort.
Admin
And I suppose I could learn to hit the "quote" button if I'm going to participate here. :P
Admin
Admin
Admin
The problem I have with saying it's a "java math problem" is that the problem isn't specific to Java at all.
It's like describing integer overflow as a "java numbers problem".
Admin
I agree that as an arbitrary statement it extends beyond Java and shouldn't be thought of as "the java problem" or even "the java error", but in the context of his email, where he's describing the problem to a client who (presumably) understands that their application is written in Java I'd say his statement is acceptable....
Admin
When editing e-mails in Outlook 2003, sometimes I didn't notice that edits after the first autosave were lost. Later I did notice that some edits were getting lost, but when I repeated the edits and saved again, sometimes I didn't notice that the edits were lost again. And if that isn't enough, sometimes I did notice, but Outlook 2003 automatically sent the garbled messages before I had time to edit them again.
After gradually figuring out that Outlook 2003 was losing edits, I did several Google searches, and finally one Google search found the solution: Upgrade from Internet Explorer 11 to Internet Explorer 10.
Outlook Express had problems in its day too, but they weren't as bad as this.
Admin
For those that care or are interested (ie. no one), here's what C# does (Spoiler: it's the same as Java)
Admin
Admin
Perhaps. But even the solution he described was a half-fix (rounding to fix rounding, instead of using a safer type), so I'm hesitant to give him credit of just being informal in his description.
I think the reason I reacted to that the way I did, though, is because statements like that are just fodder for those that want to say "that's why java is stupid and I use Brainfuck instead!".
I mean, it is stupid... but not because math is broken.
Admin
The scanned map reminds me of a customer I once dealt with. We had asked for a packet capture, and was sent a .BMP screen capture of a command window running tcpdump.
Admin
Admin
It might be that he was dealing with an existing interface where a float was being passed and he was unable to modify the interface specification.....
...or maybe I'm clutching at straws.
Admin
In fact it's every bit as much an approximation, when you count all the missing bits that would be needed to represent it exactly.
But not well enough known (since so many people keep screwing it up despite all the tutorials that try to explain it) and not an error (though so many people don't understand that it's not an error despite all the tutorials that try to explain it).Does 1.0/3.0 * 100.0 = 33.33333333? Is it an error that they're not equal? Is math broken?
Let alone the number of people who don't understand why 1 / 3 * 100 doesn't equal 33. Beyond some point, students do magically learn why this happens. One of the inventions in BASIC used to be that this was fixed for beginners, or floated for beginners, so that 1 / 3 * 100 did equal 33.33333333; and, um, 1 / 3 * 300 did equal 99.99999999, so I guess this industry is hopeless after all.
No wonder IBM was considering putting decimal floating point hardware back in some of their machines, after an absence of 50 years, despite its obvious inefficiencies. They know who their customers are. But 1.0 / 3.0 * 300.0 will still come out as 99.99999999 so it's still hopeless.
Admin
Everyone knows that 100.0 / 3.0 = 33.3
Admin
Admin
Have you gone insane? There is no word of wisdom in this entire rambling.
1000.57=57 is not an approximation, it's an equality. 1000.57=56.999999999 is a falsehood. And 100/3 = 33.333333333 is also wrong, no matter how many 3's you write - barring you write infinitely many of them.
Finitely representing real numbers (no matter what your scheme) is going to introduce errors. The fact that this is unavoidable doesn't mean that the errors aren't errors. Moreover, in nearly every representation scheme of real numbers (certainly the floating point representation) you can represent some numbers exactly. In fact, you can represent 2^b numbers exactly, when using b bits. The number 57 is one of them.
Admin
[* Oops. Almost exactly ^_^ ]
Admin
That's where I've been going wrong all this time. I've been saving it as a jpg, not a png.
It's easy to get elitist about what tools are being used. IN extreme cases it's "What, you mean you don't use Notepad++? What sort of neanderthal are you?"
Cue the "real programmers use" xkcd cartoon.
Admin
I think he probably meant to type: 816.80085
Admin
or Basingstoke.
Admin
I take it you read thedailywtf on a calculator held upside-down? For the rest of us, it works up the right way.
Admin
File under: Wolf of Wall Street.
As for emailing the map: Maybe they work with paper dossiers for every destination, so they'd normally photocopy (not print) the paper printout for "paper customers", and necessarily scan again the printout for "email customers".
I mean 'necessarily' not in the common broad sense, but in the narrow sense of '... given the employees capacities and limitations'.
Captcha: "Scan this again, Luke, it is your DISTINEO."
Admin
I reckon the right way would be to use something like Jing that can save the PNG directly rather than go through the whole paste step.
Though just yesterday I got a screenshot in tiff format from a user of an ancient Mac! It was that file that made me realise I had Photoshop installed on my work computer, albeit an expired trial.
Admin
Admin