![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
D3 Release Version 7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. D3 Linux 7.5.0 with all patches loaded System Release Information ========================== D3 Release Version 7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. I have a file with 461851 records. Atribute 1 is D or H. Atribute 2 is a number with 2 decimals. I have a program that adds to 2 variables the D and the H records. Compiled without flashbasic: REGS 461851 DEBE 1512942489.36 HABER 1512942489.36 Compiled with flashbasic without F option REGS 461851 DEBE 1512942489.36 HABER 1512942489.36 Compiled with flashbasic with F option REGS 461851 DEBE 1512942489.3599 HABER 1512942489.3598 NO RECORD OF THE FILE HAS MORE THAN 2 DECIMALS. THE PROGRAM ONLY ADDS *--------------------------- IF R<1> = 'D' THEN DEBE = DEBE + R<2 END ELSE HABER = HABER + R<2 END *---------------------------- How can the result has 4 decimals? It happens the same with D3 Linux 7.4.0 joseba |
#3
| |||
| |||
|
|
Let me get this one before Tony weighs in: It's probably a floating point processor interface error in the OS. Get around it this way: IF R<1> = 'D' THEN * *DEBE = DEBE + R<2> 2 *<-- round to two decimals END ELSE * *HABER = HABER + R<2> 2 *<-- ditto END This could have implications for TL if the math isn't perfect. It may have already been fixed in a patch/release. See your support people. Ed "jra" <jrajos... (AT) gmail (DOT) com> wrote in message news:99f2958d-9ef0-4eb3-8ae0-7b77a6533a52 (AT) h11g2000yqb (DOT) googlegroups.com... D3 Release Version *7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. D3 Linux 7.5.0 with all patches loaded * * * * * * * *System Release Information * * * * * * * *========================== D3 Release Version *7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. I have a file with 461851 records. Atribute 1 is D or H. Atribute 2 is a number with 2 decimals. I have a program that adds to 2 variables the D and the H records. Compiled without flashbasic: REGS * 461851 DEBE * 1512942489.36 HABER *1512942489.36 Compiled with flashbasic without F option REGS * 461851 DEBE * 1512942489.36 HABER *1512942489.36 Compiled with flashbasic with F option REGS * 461851 DEBE * 1512942489.3599 HABER *1512942489.3598 NO RECORD OF THE FILE HAS MORE THAN 2 DECIMALS. THE PROGRAM ONLY ADDS *--------------------------- IF R<1> = 'D' THEN * DEBE = DEBE + R<2 END ELSE * HABER = HABER + R<2 END *---------------------------- How can the result has 4 decimals? It happens the same with D3 Linux 7.4.0 joseba |
#4
| |||
| |||
|
|
It's the same in D3 Windows 7.4.7 so i do not think it's something in the OS (and in Linux i have tested it with different versions of RedHat and with Fedora And yes, if you round it to two decimals it works well (actually it's what we are doing), But why must i round a 2 decimal number to 2 decimals in an add instruction. joseba |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
|
D3 Release Version 7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. D3 Linux 7.5.0 with all patches loaded System Release Information ========================== D3 Release Version 7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. I have a file with 461851 records. Atribute 1 is D or H. Atribute 2 is a number with 2 decimals. I have a program that adds to 2 variables the D and the H records. Compiled without flashbasic: REGS 461851 DEBE 1512942489.36 HABER 1512942489.36 Compiled with flashbasic without F option REGS 461851 DEBE 1512942489.36 HABER 1512942489.36 Compiled with flashbasic with F option REGS 461851 DEBE 1512942489.3599 HABER 1512942489.3598 NO RECORD OF THE FILE HAS MORE THAN 2 DECIMALS. THE PROGRAM ONLY ADDS *--------------------------- IF R<1> = 'D' THEN DEBE = DEBE + R<2 END ELSE HABER = HABER + R<2 END *---------------------------- How can the result has 4 decimals? It happens the same with D3 Linux 7.4.0 joseba |
#8
| |||
| |||
|
|
Hi Joseba First rule of Pick math programming always scale before doing any operation. Things have improved. *In the early days the leading bit just fell off at fifteen so those of us used to HP calculators and only scaling at the endof a calculation got some shocks. Second rule. *Stick to Precision 4 for the overall program. *If you need to go to Precision 6 as the lunatic Australian Tax office demanded that we do for GST calculations then scale up the number during the calculation and scale back at the end JimR's link is great for the science of it. Peter McMurray"jra" <jrajos... (AT) gmail (DOT) com> wrote in message news:99f2958d-9ef0-4eb3-8ae0-7b77a6533a52 (AT) h11g2000yqb (DOT) googlegroups.com... D3 Release Version *7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. D3 Linux 7.5.0 with all patches loaded * * * * * * * *System Release Information * * * * * * * *========================== D3 Release Version *7.5.0.LINUX Most recent mload into boot abs performed at 17:44:42 on 29 Jun 2009. I have a file with 461851 records. Atribute 1 is D or H. Atribute 2 is a number with 2 decimals. I have a program that adds to 2 variables the D and the H records. Compiled without flashbasic: REGS * 461851 DEBE * 1512942489.36 HABER *1512942489.36 Compiled with flashbasic without F option REGS * 461851 DEBE * 1512942489.36 HABER *1512942489.36 Compiled with flashbasic with F option REGS * 461851 DEBE * 1512942489.3599 HABER *1512942489.3598 NO RECORD OF THE FILE HAS MORE THAN 2 DECIMALS. THE PROGRAM ONLY ADDS *--------------------------- IF R<1> = 'D' THEN * DEBE = DEBE + R<2 END ELSE * HABER = HABER + R<2 END *---------------------------- How can the result has 4 decimals? It happens the same with D3 Linux 7.4.0 joseba |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
"Mike Preece" <mich... (AT) preece (DOT) net> wrote in message news:da8ae3f0-5a15-4cf7-bcd8- Is this similar to the "wide zero" thing in U2? Yep the very same idea. *After a rethink I believe that Joseba is possibly storing his results in external format rather than internal, or as TG called it integer format,. *That could explain why the problem is occuring on a simple add with no other processing. *The original entry if not ICONVedwhen stored would have the "wide zero" issue truncated to 4 decimal places as the default precision is 4. *I would like to check the data stored before blaming the C code. Peter McMurray |
![]() |
| Thread Tools | |
| Display Modes | |
| |