Re: [firebird-support] Re: Is this a bug in ROUND function?

2019-08-30 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-08-30 04:33, Richard Damon rich...@damon-family.org [firebird-support] wrote: > On 8/29/19 3:14 PM, 'Alan McDonald' a...@meta.com.au [firebird-support] > wrote: > numeric(18, 3) will use a double for its internal representation, but I > would think it should still work. It might make more

[firebird-support] Re: Is this a bug in ROUND function?

2019-08-29 Thread pre...@technisoft-online.com [firebird-support]
Maybe the 'problem' is not in the ROUND() function but the CAST() ? Peter Technisoft

Re: [firebird-support] Re: Is this a bug in ROUND function?

2019-08-29 Thread Richard Damon rich...@damon-family.org [firebird-support]
On 8/29/19 3:14 PM, 'Alan McDonald' a...@meta.com.au [firebird-support] wrote: >   > > On 8/29/19 4:45 AM, 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

RE: [firebird-support] Re: Is this a bug in ROUND function?

2019-08-29 Thread 'Alan McDonald' a...@meta.com.au [firebird-support]
On 8/29/19 4:45 AM, 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

Re: [firebird-support] Re: Is this a bug in ROUND function?

2019-08-29 Thread Richard Damon rich...@damon-family.org [firebird-support]
On 8/29/19 4:45 AM, 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

Re: [firebird-support] Re: Is this a bug in ROUND function?

2019-08-29 Thread Slavomir Skopalik skopa...@elektlabs.cz [firebird-support]
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

[firebird-support] Re: Is this a bug in ROUND function?

2019-08-29 Thread m.djo...@gmail.com [firebird-support]
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