May just be showing best representation
main()
{
        float a=1,b=2,c=20;
        printf("%g\n",a/b*c);
}
Answer: 10
For c=21
Answer: 10.5


SQL> insert into numtypes values(1,2,20);

1 row created.

SQL> select A/B*C from numtypes;

     A/B*C
----------
      12.5
      13.5
      11.5
      10.5
        10


-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
Sent: Monday, May 13, 2013 11:12 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Possible bug in type conversion prior to comparison


On 13 May 2013, at 5:08pm, Michael Black <mdblac...@yahoo.com> wrote:

> Would appear it's not doing any casting to promote values but just
promoting
> everything to float.

I should have asked you for (1,2,20) as well and we could see whether it
outputs '10' or '10.0'.  But yes, it would appear that in Oracle, NUMERIC
means FLOAT.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to