Winamp & Shoutcast Forums Numeric calculations including fractions?

 4th August 2002, 05:03 #1 cchian Member   Join Date: Apr 2001 Posts: 73 Numeric calculations including fractions? I am trying to divide a number by another one which is not an integer (ie 1234 divided by 56.789). Is this possible? So far I have only been able to get the answer as an integer (using IntOp).
 4th August 2002, 10:09 #2 kichik M.I.A.[NSIS Dev, Mod]     Join Date: Oct 2001 Location: Israel Posts: 11,343 NSIS only deals with integers, sorry... You can always use an external DLL. NSIS FAQ | NSIS Home Page | Donate \$ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius
 5th August 2002, 02:16 #3 cchian Member   Join Date: Apr 2001 Posts: 73 Thanks for responding Kichik.
 6th August 2002, 09:20 #4 CodeSquid Member   Join Date: Dec 2001 Posts: 89 Well, try the following: StrCpy \$1 33 StrCpy \$2 88 ; 33/88=0.375 IntOp \$1 \$1 * 1000 IntOp \$3 \$1 / \$2 ; \$3 is now 375 ; Now try to output \$3: IntOp \$4 \$3 / 1000 IntOp \$5 \$3 % 1000 MessageBox MB_OK "\$4.\$5" ; output the number, in this case 0.375 Exchange 1000 with a greater value if you need more digits after the .
 6th August 2002, 17:33 #5 cchian Member   Join Date: Apr 2001 Posts: 73 Thanks for your suggestion. What I wanted to do was to divide a number (integer) by something that is not an integer (ie 5.789). In your example, if I assign 5.789 to \$2, the calculation with IntOp would ignore anything after the decimal point. It will be like 33/5 instead of 33/5.789
 Winamp & Shoutcast Forums Numeric calculations including fractions?