Re: [firebird-support] double precision remove last 2 numbers

2020-02-27 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2020-02-26 19:41, hamacker sirhamac...@gmail.com [firebird-support] 
wrote:
> When I started my test, I turn off my app.
> 
> And do update(and select) using only ISQL tool (IBExpert) and
> dbweaver.
> in both I had to configure select to show float using mask
> (0.##..), so the number can be different that I show you, but
> always eat last numbers.I need to store long decimals numbers maybe
> more than 15 decimals, is it possible without store as string?

Firebird 3 supports a maximum precision of 18 using the fixed point 
types `NUMERIC(18,x)` and `DECIMAL(18,x)`, however then you most now the 
number decimals at declaration time. If you need floating-point-like 
behaviour, you need to wait for Firebird 4, where you can use datatype 
DECFLOAT (precision of 34), or maybe the extended precision 
DECIMAL/NUMERIC with a maximum precision of 38.

Storing as string is an option, but that will make it very hard to do 
any calculation with them, and might force you to cast to `double 
precision` to perform that calculation, which throws any benefit of the 
stored precision out of the door.

Mark


Re: [firebird-support] double precision remove last 2 numbers

2020-02-26 Thread hamacker sirhamac...@gmail.com [firebird-support]
  Maybe between 8 and 15 decimals, not more.

Em qua., 26 de fev. de 2020 às 16:10, Dimitry Sibiryakov s...@ibphoenix.com
[firebird-support]  escreveu:

> 26.02.2020 19:41, hamacker sirhamac...@gmail.com [firebird-support] wrote:
> > I need to store long decimals numbers maybe more than 15 decimals, is it
> possible without
> > store as string?
>
>If your task requires such number you should consider using of Firebird
> 4 or Oracle.
>
>
> --
>WBR, SD.
>
>
> 
>
> 
>
> ++
>
> Visit http://www.firebirdsql.org and click the Documentation item
> on the main (top) menu.  Try FAQ and other links from the left-side menu
> there.
>
> Also search the knowledgebases at
> http://www.ibphoenix.com/resources/documents/
>
> ++
> 
>
> Yahoo Groups Links
>
>
>
>


Re: [firebird-support] double precision remove last 2 numbers

2020-02-26 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
26.02.2020 19:41, hamacker sirhamac...@gmail.com [firebird-support] wrote:
> I need to store long decimals numbers maybe more than 15 decimals, is it 
> possible without 
> store as string?

   If your task requires such number you should consider using of Firebird 4 or 
Oracle.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] double precision remove last 2 numbers

2020-02-26 Thread hamacker sirhamac...@gmail.com [firebird-support]
When I started my test, I turn off my app.
And do update(and select) using only ISQL tool (IBExpert) and dbweaver.
in both I had to configure select to show float using mask (0.##..), so
the number can be different that I show you, but always eat last numbers.
I need to store long decimals numbers maybe more than 15 decimals, is it
possible without store as string?

Em qua., 26 de fev. de 2020 às 15:21, Mark Rotteveel m...@lawinegevaar..nl
[firebird-support]  escreveu:

>
>
> On 2020-02-26 19:07, hamacker sirhamac...@gmail.com [firebird-support]
> wrote:
> > Hi All,
> >
> > I do this update:
> > UPDATE CV SET
> > perc_lucro=42.503064336972848
> > WHERE (id_cv=57528)
> >
> > Then I do a select and 'perc_lucro' was change to 42,5030643369728
> > after updated, two last numbers disappear.
> > Why?
> > perc_lucro is double precision type.
> > FB 3.0.5 32bits, Windows 64.
>
> A double precision is not an exact numeric type, it has roughly a
> precision of 15-17 decimals. Even that isn't entirely correct because of
> how a double precision works. In any case, a double precision cannot
> exactly store 42.503064336972848.
>
> However, when testing this (with `select cast(42.503064336972848 as
> double precision) from rdb$database`), I get a value of
> 42.50306433697285, which suggest that your software may do some
> additional rounding or truncation when presenting the value.
>
> Mark
> 
>


Re: [firebird-support] double precision remove last 2 numbers

2020-02-26 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2020-02-26 19:07, hamacker sirhamac...@gmail.com [firebird-support] 
wrote:
> Hi All,
> 
> I do this update:
> UPDATE CV SET
>   perc_lucro=42.503064336972848
> WHERE (id_cv=57528)
> 
> Then  I do a select and 'perc_lucro' was change to 42,5030643369728
> after updated, two last numbers disappear.
> Why?
> perc_lucro is double precision type.
> FB 3.0.5 32bits, Windows 64.

A double precision is not an exact numeric type, it has roughly a 
precision of 15-17 decimals. Even that isn't entirely correct because of 
how a double precision works. In any case, a double precision cannot 
exactly store 42.503064336972848.

However, when testing this (with `select cast(42.503064336972848 as 
double precision) from rdb$database`), I get a value of 
42.50306433697285, which suggest that your software may do some 
additional rounding or truncation when presenting the value.

Mark


[firebird-support] double precision remove last 2 numbers

2020-02-26 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi All,

I do this update:
UPDATE CV SET
  perc_lucro=42.503064336972848
WHERE (id_cv=57528)

Then  I do a select and 'perc_lucro' was change to 42,5030643369728 after
updated, two last numbers disappear.
Why?
perc_lucro is double precision type.
FB 3.0.5 32bits, Windows 64.