For exact numbers you have to use exact numeric types.

Double is float point type with all advantages and disadvantages.

Look here https://en.wikipedia.org/wiki/Double-precision_floating-point_format

Just for fun, try this:

1e20 + 1 + 1 - 1e20 + 1

Slavek

Ing. Slavomir Skopalik
Executive Head
Elekt Labs s.r.o.
MASA - Collection and evaluation of data from machines and laboratories
http://eng.elektlabs.cz/products-and-services/masa
-----------------------------------------------------------------
Address:
Elekt Labs s.r.o.
Chaloupky 158
783 72 Velky Tynec
Czech Republic
---------------------------------------------------------------
Mobile: +420 724 207 851
icq:199 118 333
skype:skopaliks
e-mail:skopa...@elektlabs.cz
http://www.elektlabs.cz

On 29.08.19 13:45, m.djo...@gmail.com [firebird-support] wrote:
In binary representation of the values maybe 4.72 is the closest, but we are talking about mathematic.
This is from the description of the ROUND function in the documentation:
Rounds a number to the nearest integer. If the fractional part is exactly 0.5, rounding is upward for positive numbers and downward for negative numbers. So .725 is all cases is rounded up to .73 as it should be, but in one case it is not.

------------------------------------------------------------------------
Posted by: m.djo...@gmail.com
------------------------------------------------------------------------
Reply via web post <https://groups.yahoo.com/neo/groups/firebird-support/conversations/messages/134414;_ylc=X3oDMTJycG5icXRtBF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BG1zZ0lkAzEzNDQxNARzZWMDZnRyBHNsawNycGx5BHN0aW1lAzE1NjcwNzkxMzU-?act=reply&messageNum=134414> • Reply to sender <mailto:m.djo...@gmail.com?subject=Re%3A%20Is%20this%20a%20bug%20in%20ROUND%20function%3F> • Reply to group <mailto:firebird-support@yahoogroups.com?subject=Re%3A%20Is%20this%20a%20bug%20in%20ROUND%20function%3F> • Start a New Topic <https://groups.yahoo.com/neo/groups/firebird-support/conversations/newtopic;_ylc=X3oDMTJlYWJzYW5rBF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTU2NzA3OTEzNQ--> • Messages in this topic <https://groups.yahoo.com/neo/groups/firebird-support/conversations/topics/134385;_ylc=X3oDMTM4YzFwcDZ2BF9TAzk3MzU5NzE0BGdycElkAzI0NDI0MDYEZ3Jwc3BJZAMxNzA1MTE1Mzg2BG1zZ0lkAzEzNDQxNARzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzE1NjcwNzkxMzUEdHBjSWQDMTM0Mzg1> (3)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  • [firebird-suppo... m.djo...@gmail.com [firebird-support]
    • Re: [fireb... Richard Damon rich...@damon-family.org [firebird-support]
      • [fireb... m.djo...@gmail.com [firebird-support]
        • Re... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
        • Re... Slavomir Skopalik skopa...@elektlabs.cz [firebird-support]
        • Re... Richard Damon rich...@damon-family.org [firebird-support]
          • ... 'Alan McDonald' a...@meta.com.au [firebird-support]
            • ... Richard Damon rich...@damon-family.org [firebird-support]
              • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
    • [firebird-... pre...@technisoft-online.com [firebird-support]

Reply via email to