Sunday, September 09, 2007
I won't cover here the topic of Exception handling in MDX, but show you a funny thing that I have never seen in any computer language. Consider this MDX code:

iif (1.0e+40 * 1.0e+40 = (1/0), "Overflowed", "Didn't Overflow")*

On some processors, this code will output "Overflowed". That's because this multiplication will overflow and (1/0) also overflows, so what we have here is two "overflow values" that are equal.

Where on earth have you seen something like this???


* Taken from the book "MDX Solutions" second edition, p. 136


 | 
Monday, September 10, 2007 11:44:05 AM (Jerusalem Daylight Time, UTC+03:00)
> Where on earth have you seen something like this???

In VB6
_
Monday, September 10, 2007 2:29:25 PM (Jerusalem Daylight Time, UTC+03:00)
The processing state after the initial overflow is such that the contents of the two memory addresses are probably unknown. It might be co-incidental that they are equal.

Tuesday, September 11, 2007 8:14:51 PM (Jerusalem Daylight Time, UTC+03:00)
Hey,
Anonymous - Maybe you're right. The last time I coded in VB6 was six years ago.
Steve - Incidents won't happen at every trial. This "phenomenon" will happen every time, on many computers. The only thing that matters is the CPU series.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):