Subject Re: [firebird-support] It´s a bug or whatever?
Author hamacker
Thanks.

One more question, It´s a firebird way or it´s a math general consensus?

I try a lot of programs, and only firebird return wrong value.

2015-10-29 16:30 GMT-02:00 setysvar setysvar@... [firebird-support] <firebird-support@yahoogroups.com>:
 

Den 29.10.2015 19:22, skrev hamacker sirhamacker@... [firebird-support]:
Hi everybody.

When I try:
select (2183.48/(1-(37.25/100))) as valor from rdb$database

As result  Firebird: 3465,8412
But other databases(MSSQL) and spreadshets(Excel and Calc) the correct result is 3479,6494023904

If I change  (37.25/100) to 0.3725 as follow:
select (2183.48/(1-0.3725)) as valor from rdb$database

Then Result is correct 3479,6494023904

I would like to understand why this
or if it´s a new bug to post.

Firebird-2.5.4.26856_0_Win32

No, I don't think this is a bug. If you do

select 37.25/100 as valor from rdb$database

the result is 0.37, not 0.3725. To fix your original problem (well, it will be rounded to 4 digits after the decimal point, just add zeroes (or cast):

select (2183.48/(1-(37.2500/100))) as valor from rdb$database

HTH,
Set