Re: [DQSD-Users] Odd Math Error
Hi Richard, Is there no way to set DQSD to preform normal arithmetic functions? You can use the VBSX function as a wrapper to force VB-style mathematic operations. Here's an example: vbsx =cdbl(2156737.51 - 16123.85) You can add an alias for this to localaliases.txt as so: m|vbsx =cdbl(%s)|Safe math|Safe math|Finance Since you're calling it directly, and the formula isn't being simply interpreted from the command-line, it is easy to raise errors by submitting invalid values (m 1/0). So, be careful with that kind of thing. ;) You can use other math operators this way, too, like power (^) and modulo (mod) and whole value division (\ - eliminates the remainder). m 10 ^ 8 m 17 mod 4 m 9 \ 2 And more: http://www.w3schools.com/vbscript/vbscript_ref_functions.asp#math I'll bet with a bit of hacking in calculate.js, it would be possible to change the default behaviour for mathematic formulae to this processing method. Personally, I could care less. The JS method has almost always served my needs, and when it hasn't, Google fills in nicely. Regards, Shawn K. Hall http://12PointDesign.com/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
Re: [DQSD-Users] Odd Math Error
I tried it again cutting and pasting it verify that I was not corrupting the data. I also tried; 2156737.51 - 16123.85 Which netted the same result. So from the other emails on this subject I can see that I definitely misunderstood about DQSD's ability to perform calculations in a normal manner. What a shame, and waiting for google to run the calc and return it is a pill too. Is there no way to set DQSD to preform normal arithmetic functions? I'll admit I am lost on the way this is functioning, but to me the end result is it works for some math and others it doesn't and therefore cant be trusted. Perhaps on the functions list it should be made clear that this is not doing standard arithmetic but binary. Or maybe I'm the only person out here who looks at this and goes What?!?!?!?!. On 5/18/07, Kim Gräsman [EMAIL PROTECTED] wrote: Hi Richard, Uhhh that doesnt sound right to me. I subtracted 3 different values from another value and got the same result twice. Oops, I didn't see your results were identical for the first two cases. I tried it here; 2156737.51 - 16123.81 = 2140613.67 2156737.51 - 16123.83 = 2140613.679997 -- Note: .6_7_999... 2156737.51 - 16123.82 = 2140613.69 Could you try it again to make sure you transcribed the values correctly? Also two of the results are flat out wrong. Right, but they're pretty close to correct, which is what you get with floating-point, if I understand things correctly. I could understand if I had used some kind of hokey notation but its a straight up math problem X-Y. When performed in a calculator application I dont get that result? The calculator (at least the one in Windows) probably doesn't use floating-point to store its numbers, but again, I'm a bit out of my depth here. Cheers, - Kim - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601 -- Richard Ahlquist Systems Analyst Webmaster http://www.patentlystupid.com http://www.pcsites.com http://www.unlimitedbs.com - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
Re: [DQSD-Users] Odd Math Error
Hi Richard, [EMAIL PROTECTED] wrote: I tried it again cutting and pasting it verify that I was not corrupting the data. I also tried; 2156737.51 - 16123.85 Which netted the same result. So from the other emails on this subject I can see that I definitely misunderstood about DQSD's ability to perform calculations in a normal manner. What a shame, and waiting for google to run the calc and return it is a pill too. Is there no way to set DQSD to preform normal arithmetic functions? I'll admit I am lost on the way this is functioning, but to me the end result is it works for some math and others it doesn't and therefore cant be trusted. Perhaps on the functions list it should be made clear that this is not doing standard arithmetic but binary. Or maybe I'm the only person out here who looks at this and goes What?!?!?!?!. Yeah, when I first learned about this, I was flabbergasted. Now, I just don't care so much. I hope you realize that this is not a conscious choice on the behalf of the DQSD developers -- we just delegate any math operations to JavaScript, which -- like most other compilers/interpreters -- uses IEEE 754 floating point arithmetics. It *is* normal. That said, what you're seeing sounds really weird. The fact that so widely different numbers yield the same result is strange... I can't explain it. Cheers, - Kim - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
Re: [DQSD-Users] Odd Math Error
Kim, Uhhh that doesnt sound right to me. I subtracted 3 different values from another value and got the same result twice. Also two of the results are flat out wrong. I could understand if I had used some kind of hokey notation but its a straight up math problem X-Y. When performed in a calculator application I dont get that result? On 5/17/07, Kim Gräsman [EMAIL PROTECTED] wrote: Hi Richard, [EMAIL PROTECTED] wrote: Had something really screwy happen today, had to do some math so I dropped into my DQSD bar and typed; 2156737.51 - 16123.81 and it gives me the result; 2140613.67 WOW! That's how floating-point arithmetic works on most PCs. I can never describe it without at least confusing accuracy and precision, so I suggest you Google for details :-) http://www.google.com/search?q=floating-point+arithmetic I really have a hard time understanding the details myself, but I know it's how it's supposed to be, even if it's disconcerting. Cheers, - Kim - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601 -- Richard Ahlquist Systems Analyst Webmaster http://www.patentlystupid.com http://www.pcsites.com http://www.unlimitedbs.com - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
Re: [DQSD-Users] Odd Math Error
Hi Richard, Uhhh that doesnt sound right to me. I subtracted 3 different values from another value and got the same result twice. Oops, I didn't see your results were identical for the first two cases. I tried it here; 2156737.51 - 16123.81 = 2140613.67 2156737.51 - 16123.83 = 2140613.679997 -- Note: .6_7_999... 2156737.51 - 16123.82 = 2140613.69 Could you try it again to make sure you transcribed the values correctly? Also two of the results are flat out wrong. Right, but they're pretty close to correct, which is what you get with floating-point, if I understand things correctly. I could understand if I had used some kind of hokey notation but its a straight up math problem X-Y. When performed in a calculator application I dont get that result? The calculator (at least the one in Windows) probably doesn't use floating-point to store its numbers, but again, I'm a bit out of my depth here. Cheers, - Kim - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
Re: [DQSD-Users] Odd Math Error
It's all about binary arithmetic. Spreadsheets have traditionally had this same issue. There are workarounds for it, but there's a substantial performance penalty and in most cases it's simply not enough to worry about. The number is always only off by one bit at the limit of your precision. -Original Message- From: [EMAIL PROTECTED] [mailto:dqsd-users- [EMAIL PROTECTED] On Behalf Of Kim Gräsman Sent: May-17-07 10:09 PM To: DQSD users mailing list Subject: Re: [DQSD-Users] Odd Math Error Hi Richard, Uhhh that doesnt sound right to me. I subtracted 3 different values from another value and got the same result twice. Oops, I didn't see your results were identical for the first two cases. I tried it here; 2156737.51 - 16123.81 = 2140613.67 2156737.51 - 16123.83 = 2140613.679997 -- Note: .6_7_999... 2156737.51 - 16123.82 = 2140613.69 Could you try it again to make sure you transcribed the values correctly? Also two of the results are flat out wrong. Right, but they're pretty close to correct, which is what you get with floating-point, if I understand things correctly. I could understand if I had used some kind of hokey notation but its a straight up math problem X-Y. When performed in a calculator application I dont get that result? The calculator (at least the one in Windows) probably doesn't use floating-point to store its numbers, but again, I'm a bit out of my depth here. Cheers, - Kim - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601