IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New A caveat from Borland:
[link|http://community.borland.com/article/0,1410,17139,00.html|Link.]
When searching through real world data, we can't expect to always find exact matches. This is particularly true with floating point data, where the need to convert the numbers to a form the computer can store in binary leads to minor precision or round-off deviations. One solution is to consider the numbers equal if the difference between absolute values of the two numbers is less than some threshold amount.
Simply put, direct comparisons of floating point data is not a good idea.
Alex

"No man's life, liberty, or property are safe while the legislature is in session."\t-- Mark Twain
New This was slightly different.
Comparing floating point, I understand. If you are careful to stick to IEEE and are aware of the pitfalls, you should be ok.

Non-deterministic behaviour, where putting the same calculation on each side of the == operation gives you a false... well, that's a little odd. Anyway, cause identified and fixed, and I've raised the flag that our MS stuff may or may not be correct.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Re: This was slightly different.
You can't just wave your hand like that! This is a real problem! APL compares numbers flawlessly since 1968 or so - float or not. You should NOT have to restrict the compiler to this or that assumption about the data UNLESS the compiler says "implicit conversion of double to float" or whatever if you don't.
-drl
New Oh - to discover a real compiler problem
..is real cool! Once I had to write a big string processing program in FORTRAN (!!) so I stumbled across a problem with the IBM VS FORTRAN compiler regarding character data - man those guys hopped to it! A tape with the fixed compiler on it was in the lab the next day. It was a real "code red" for the compiler people - I was stoked about that :)
-drl
New This is not considered a compiler problem by the GCC folks.
Basically, it is this:

IEEE designates that doubles should be held as 64-bits in memory. The Intel FPU, however, has 80 bits available for calculations. So it comes down to 1) being aware of the platform on which you are running, and 2) using a programming strategy that ensures the FPU is used as you need it to be used.

For many applications, the extra 16 bits of precision is a good thing. For some applications, such as mine, a much greater control over rounding and precision is needed, and means are provided for making use of what you need to use.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Scott, that's a bug worthy of catching
Damn. (Okay, so technically speaking it's probably not a bug...but still....)
New Fun to track down, at least.
Since I learned a truckload about the subject matter. But again, the key piece was Chris' analysis of the ASM output.

Reading through the FAQs and newsgroups (now that I know what to look for) it's also quite commonly reported as a bug. :-P
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     C decimal question: - (admin) - (53)
         Equality on Real/Double is always a crapshoot - (tablizer)
         Don't know... - (Simon_Jester)
         Re: C decimal question: - (deSitter) - (1)
             Makes no difference. - (admin)
         The boolean compare operators - (ChrisR) - (36)
             I've done the subtract - (admin) - (35)
                 Assembly dump? - (ChrisR) - (22)
                     I did my dump with GDB - (Arkadiy)
                     What I get: - (admin) - (20)
                         Speculating... - (ChrisR) - (19)
                             gcc 2.95.4 results - (admin) - (18)
                                 Re: gcc 2.95.4 results - (deSitter) - (1)
                                     EBP is base of stack frame - (Arkadiy)
                                 I86 Assembly is not my specialty... - (ChrisR)
                                 ASM Comments - (ChrisR) - (13)
                                     Errrr... - (admin) - (12)
                                         Getting ASM from VC6 - (deSitter) - (11)
                                             Results - (deSitter) - (10)
                                                 Request... - (ChrisR) - (9)
                                                     Re: Request... - (deSitter) - (8)
                                                         Trimming it down... - (ChrisR) - (7)
                                                             Re: Trimming it down... - (deSitter) - (6)
                                                                 Scratches head... - (ChrisR) - (5)
                                                                     Re: Scratches head... - (deSitter) - (4)
                                                                         Thanks... - (ChrisR) - (3)
                                                                             BTW - (deSitter) - (2)
                                                                                 Hmmmm - (ChrisR) - (1)
                                                                                     puts("42"); -NT - (deSitter)
                                 gcc 2.95.26 - (ChrisR)
                 Did you try it with optimizations off? -NT - (deSitter) - (7)
                     A really good optimizing compiler... - (ChrisR) - (6)
                         Yes.. - (deSitter)
                         Compiler has no way to predict how pow() is implemented - (Arkadiy) - (4)
                             IEEE - (deSitter) - (2)
                                 pow() is library, not hardware - (Arkadiy) - (1)
                                     True - (deSitter)
                             Re: Compiler has no way to predict how pow() is implemented - (deSitter)
                 An option of interest? - (ChrisR) - (3)
                     I'll look into that. Datum: gcc 3.2.1 on glibc 2.3.1 -NT - (admin)
                     Doesn't seem to make any difference. - (admin) - (1)
                         Re: Doesn't seem to make any difference. - (deSitter)
         Not a direct answer, but still on-topic. - (static)
         RESOLUTION: - (admin) - (10)
             A caveat from Borland: - (a6l6e6x) - (6)
                 This was slightly different. - (admin) - (5)
                     Re: This was slightly different. - (deSitter)
                     Oh - to discover a real compiler problem - (deSitter) - (1)
                         This is not considered a compiler problem by the GCC folks. - (admin)
                     Scott, that's a bug worthy of catching - (Simon_Jester) - (1)
                         Fun to track down, at least. - (admin)
             Re: RESOLUTION: - (deSitter) - (2)
                 Historically speaking... - (ChrisR) - (1)
                     Re: Historically speaking... - (deSitter)

Almost never.
485 ms