-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
CREATE TABLE floatsucks (
    id INTEGER NOT NULL,
    s1 VARCHAR(20),
    s2 VARCHAR(20),
    PRIMARY KEY(id)
);

INSERT INTO floatsucks VALUES(1,'100.0','100.0');
INSERT INTO floatsucks VALUES(2,'100.0','100.1');
INSERT INTO floatsucks VALUES(3,'10000.0','10000.0');
INSERT INTO floatsucks VALUES(4,'10000.0','10000.1');
INSERT INTO floatsucks VALUES(5,'1000000.0','1000000.0');
INSERT INTO floatsucks VALUES(6,'1000000.0','1000000.1');
INSERT INTO floatsucks VALUES(7,'100000000.0','100000000.0');
INSERT INTO floatsucks VALUES(8,'100000000.0','100000000.1');

-- does not work
SELECT id,s1,s2,s1=s2,CONVERT(FLOAT(12,1),s1)=CONVERT(FLOAT(12,1),s2) FROM floatsucks;

DROP TABLE floatsucks;
