Re: [Firebird-devel] DECFLOAT documentation unclear

2017-06-17 Thread Alex via Firebird-devel



On 17.06.2017 13:45, Mark Rotteveel wrote:

You mailed this to me directly instead of the list, was that intentional?



Use laptop to answer, pressed something wrong I think.


On 17-6-2017 11:20, Alex wrote:

On 17.06.2017 11:21, Mark Rotteveel wrote:
/doc/sql.extensions/README.data_types contains the following about 
DECFLOAT


"Although length of DECFLOAT(34) literal can exceed 6000 bytes 
(0.000<6000 zeros>00123) implementation limit exists - length of 
such literal should not exceed 1024 bytes."


I believe that should read "length of DECFLOAT(34) **value** ..."

Because it makes no sense that a literal can exceed 6000 bytes and a 
literal should not exceed 1024 bytes. And otherwise, this really 
needs more copy-editing to clarify what is really meant.




Mark, I've meant that literal as long as 6000 bytes (0.000..<5800 
zeroes>..0324663567201) can be converted into correct decfloat value 
not loosing precision. But the typical representation of such 
literals is 0.324663567201E-5803, therefore limiting length of 
literal that can be used in firebird to 1Kb is not big problem. If 
someone can explain it better feel free to fix docs or send correct 
form to me. Please keep in mind that I'm not native English speaker...


Literals are what are used to represent the value in a query string. 
So is the limit 1024 or 6000+ for literals? It can't be both. Would 
using 0.000..5800*0..0324663567201 (with the zeros expanded) in a 
query string work or not?


I assume the limit is 1024 characters (or bytes?), in that case I'd 
suggest to start with stating that limit first, and then explain that 
longer values can usually be transformed to a correct value using the 
scientific notation.


To be honest, I think the limit can even be for shorter than 1024, no 
one in their right mind would use literals like that.


Yes, but it's much simpler to make temp buffer large enough than have 
additional discussion about it here :)




Something like:

"""
The length of DECFLOAT literals are limited to 1024 characters. For 
longer values, you will need to use the scientific notation. For 
example, the 0.0..1020 zeroes..11 cannot be used as a literal, instead 
you can use the equivalent in scientific notation: 1.1E-1022. 
Similarly 1..1023 zeroes..0 can be presented as 1.0E1024

"""



Done, thank you.



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] DECFLOAT documentation unclear

2017-06-17 Thread Mark Rotteveel

/doc/sql.extensions/README.data_types contains the following about DECFLOAT

"Although length of DECFLOAT(34) literal can exceed 6000 bytes 
(0.000<6000 zeros>00123) implementation limit exists - length of such 
literal should not exceed 1024 bytes."


I believe that should read "length of DECFLOAT(34) **value** ..."

Because it makes no sense that a literal can exceed 6000 bytes and a 
literal should not exceed 1024 bytes. And otherwise, this really needs 
more copy-editing to clarify what is really meant.


Mark
--
Mark Rotteveel

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel