/ Ticket Change Details
Login
Overview

Artifact ID: e97acd84dfb42d324b5de6f9af04cfcb52ac101dc85876e50a297e1caf98e3b7
Ticket: 3c27b97e319a263a607253b34270f4747ef8fac6
REAL rounding seems to depend on FROM clause
User & Date: mrigger 2019-05-16 17:52:14
Changes

  1. Change foundin to "3.28"
  2. Change icomment to:

    It seems that depending on the FROM clause, a different floating-point rounding is performed as demonstrated in the example below. Although programmers should not compare floating-point numbers using equality operators, the result should not depend on the FROM clause either. It is not certain that this can be reproduced on all machines.

    CREATE TABLE t0 (c0);
    CREATE TABLE t1 (c1 REAL);

    INSERT INTO t1(c1) VALUES (8366271098608253588);
    INSERT INTO t0(c0) VALUES ('a');

    SELECT * FROM t1 WHERE (t1.c1 = CAST(8366271098608253588 AS REAL)); -- fetches row
    SELECT * FROM t0, t1 WHERE (t1.c1 = CAST(8366271098608253588 AS REAL)); -- fetches no row
    SELECT * FROM t0, t1 WHERE (t1.c1 >= CAST(8366271098608253588 AS REAL) AND t1.c1 <= CAST(8366271098608253588 AS REAL)); -- fetches row

  3. Change login to "mrigger"
  4. Change mimetype to "text/x-fossil-wiki"
  5. Change severity to "Critical"
  6. Change status to "Open"
  7. Change title to "REAL rounding seems to depend on FROM clause"
  8. Change type to "Code_Defect"