Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP bug? this is very strange

Status
Not open for further replies.

papadopo

Programmer
Mar 11, 2003
10
0
0
CY
Hello everybody,

I use VFP 7

I have a table MyTable.DBF with a field MyField N(15,4) with values

23334.9000
23334.9000
23334.9000

I go:

SELECT MyTable
CALCULATE STD(MyField) TO X

VFP gives as result x = *******************

instead of 0

the really weird thing is that when i change the values to

23334.9100
23334.9100
23334.9100

I get the correct result

Another thing is that if i go

SET DECIMALS TO 2

the STD works fine with these specific values ( 23334.9000
)

Have you heard of anything about this sort of thing? Is this a bug?

----------
"Never Send a Human to do a Machine's Job"
 
i tried it in 6 & 8 and i got 0 in both... i don't have 7 or i'd try that too

are you doing this in the command window and then displaying "x"? or are you putting this into a table with perhaps not the correct field size? that could give you those results, too

 
More curious, I ran the following code in VFP 5.0a SP3, VFP 6.0 SP5, VFP 7.0 SP1, VFP 8.0 SP1 and VFP 9.0 beta (build 1720).
Code:
set talk on
set decimals to 2
CREATE cursor MyTable (MyField N(15,4))
INSERT INTO Mytable VALUES (23334.9000)
INSERT INTO Mytable VALUES (23334.9000)
INSERT INTO Mytable VALUES (23334.9000)

SELECT MyTable
CALCULATE STD(MyField) TO X
?x
It worked "right" in all but 5.0.

If I changed the 2nd line to:
set decimals to 4
It "failed" in all of them.

Rick
 
kenndot: yes, im doing this in the command window.

How come this fails with

set decimals to 4

for this specific values. for other values it works just fine

----------
"Never Send a Human to do a Machine's Job"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top