Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: BINTOC(,8) and negative zero
Message
From
03/12/2004 05:08:08
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG: BINTOC(,8) and negative zero
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00966627
Message ID:
00966627
Views:
62
Previous issue Thread #966292

Bug/Issue : 24 of 36

TITLE: BUG: BINTOC(,8) and negative zero

VERSION: 09.00.0000.1720

EXPECTED: X=Y if and only if BINTOC(X,8)=BINTOC(Y,8)

OBSERVED: 0.0=-0.0 and BINTOC(0.0,8)<>BINTOC(-0.0,8)

NOTES: with this bug BINTOC(,8) is unusabled because
any computation that it annuls a value has memory of the sign that had the value before being annulled.

With 'B' conversion the problem remains

REPRO
CLEAR
? 0=-0,BINTOC(0,1)=BINTOC(-0,1)
? 0=-0,BINTOC(0,2)=BINTOC(-0,2)
? 0=-0,BINTOC(0,4)=BINTOC(-0,4)
? 0.0=-0.0,BINTOC(0.0,8)=BINTOC(-0.0,8)

?
? '*****TEST2'
* THEN ANY NEGATIVE VALUES COLLAPSED TO ZERO
* MANTAIN THE SIGN MEMORY !
X=-344.000
Y=0
X=X*Y
? X=0,BINTOC(X,8)=BINTOC(0.0,8)

?
? '****TEST3'

CREATE CURSOR test ( bb B)
INDEX ON BINTOC(bb,8) TAG cTag
? 'INSERT A NEGATIVE NOT ZERO VALUE'
INSERT INTO test VALUES (-344.0E0)
? 'FOUND'
? BB=-344.0E0,SEEK(BINTOC(-344.0E0,8))
? 'ANNULS IT'
REPLACE bb WITH bb*0
? 'NOT FOUND'
? BB=0.0E0,SEEK(BINTOC(0.0E0,8))
? 'TRY TO CLEAR PATH COMPUTATION MEMORY'
REPLACE bb WITH 0.0E0
? 'FAIL => VFP compare the value and not update the index ?'
? BB=0.0E0,SEEK(BINTOC(0.0E0,8))
? 'INSERT A NEW POSITIVE VALUE'
INSERT INTO test VALUES (344.0E0)
? 'FOUND'
? BB=344.0E0,SEEK(BINTOC(344.0E0,8))
? 'ANNULS IT'
REPLACE bb WITH bb*0
? 'FOUND'
? BB=0.0E0,SEEK(BINTOC(0.0E0,8))
Next
Reply
Map
View

Click here to load this message in the networking platform