Re: [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Mark Morgan Lloyd
Andrew Brunner wrote: Can someone check the status of update if the bind parameter for double decimal values? I'm getting unexpected rounding errors after updating - the data in the column looks different than what was specified during the update statement. Value: double;

[fpc-devel] InstantFPC

2011-07-11 Thread dhkblaszyk
ZeelandNet Webmail I would like to create a patch for instantfpc but would like to ask first here. The patch will add a new extension (.ppx) to instantfpc and the installers so it get's registered with the OS after installing. Is this ok with everybody? Darius

Re: [fpc-devel] InstantFPC

2011-07-11 Thread michael . vancanneyt
On Mon, 11 Jul 2011, dhkblas...@zeelandnet.nl wrote: ZeelandNet Webmail I would like to create a patch for instantfpc but would like to ask first here. The patch will add a new extension (.ppx) to instantfpc and the installers so it get's registered with the OS after installing. Is this

Re: [fpc-devel] Const optimization is a serious bug

2011-07-11 Thread Jonas Maebe
On 11 Jul 2011, at 02:08, Chad Berchek wrote: Even if the calling convention does not change, the semantics can, as currently implemented. Even within a single platform const is ill-defined. Consider the case of AnsiString. There are three cases as it is currently implemented: 1) Ref

RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Ludo Brands
1.) Update Value : 40734.825668912039 2.) Actual Value after update : 40734.825668912 3.) Actual Value on read : 40734.825668912003 Several things here: - floattostr(40734.825668912039) equals 40734.825668912. - update table set t_double = 40734.825668912039 where id

Re: [fpc-devel] Const optimization is a serious bug

2011-07-11 Thread Alexander Klenin
On Mon, Jul 11, 2011 at 15:35, Hans-Peter Diettrich drdiettri...@aol.com wrote: Alexander Klenin schrieb: To which data type do you want apply your constval modifier, with which concrete effects? To any datatype, of course. The result should be: 1) Parameter is passed by value How to pass

[fpc-devel] Re: MySQL 5.1 and Double (trouble)

2011-07-11 Thread Andrew Brunner
On Sun, Jul 10, 2011 at 8:00 PM, Andrew Brunner andrew.t.brun...@gmail.com wrote: 2.) Actual Value after update : 40734.825668912 This is the value as read in the MYSQL admin program table data. This is under Ubuntu 10.10 x64. ___ fpc-devel maillist

Re: RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Jonas Maebe
On 11 Jul 2011, at 13:41, Andrew Brunner wrote: On Mon, Jul 11, 2011 at 4:53 AM, Ludo Brands ludo.bra...@free.fr wrote: How do you get the 40734.825668912003 value? Fields.FieldByName(Value).AsFloat(); You are probably assigning the result to a variable of the type extended, or directly

Re: RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Andrew Brunner
Declaraions are all double. Value: double; Query.Params.ParamByName(sName).AsFloat:=Value; Also: Test:double; Test:=Query.Params.ParamByName(sName).AsFloat; Test=Value ok here. Problem must be somwhere else. 1.) Update Value : 40734.825668912039 2.) Actual Value after

[fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Joost van der Sluis
Hi all, I'm trying to set-up a VM with Solaris (x86_64). Problem is that fpc refuses to link applications. It complains that there is a syntax error in the build-in linker scripts. How that's possible, I don't know. When I use -T, so that the default linker scripts are not used, linking goes

Re: RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Jonas Maebe
On 11 Jul 2011, at 15:02, Andrew Brunner wrote: Declaraions are all double. You don't show what you do with the value before writing it out, nor how you write it out and determine that its value is 40734.825668912003 (which is probably also what Ludo meant with How do you get the

Re: [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Mark Morgan Lloyd
Joost van der Sluis wrote: Hi all, I'm trying to set-up a VM with Solaris (x86_64). Problem is that fpc refuses to link applications. It complains that there is a syntax error in the build-in linker scripts. How that's possible, I don't know. When I use -T, so that the default linker scripts

RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Ludo Brands
How do you get the 40734.825668912003 value? Fields.FieldByName(Value).AsFloat(); Floattostr limits precision to 15 digits (40734.8256689120). When updating the mysql database it converts the float to a string and looses the last 2 digits. The last digits are returned by gdb or the str

RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Ludo Brands
You need to get the gnu binutils from sunfreeware.com and set your path to include /usr/local/bin. If you want to build the compiler you'll also need the gnu make from the same source. Ludo -Message d'origine- De : fpc-devel-boun...@lists.freepascal.org

Re: [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Joost van der Sluis
On Mon, 2011-07-11 at 15:52 +0200, Ludo Brands wrote: You need to get the gnu binutils from sunfreeware.com and set your path to include /usr/local/bin. I have them installed. (Well, using 'pkg install gnu-binutils') Or else gld wouldn't be available at all. And there is no '/usr/local/bin'?

Re: RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Hans-Peter Diettrich
Ludo Brands schrieb: How do you get the 40734.825668912003 value? Fields.FieldByName(Value).AsFloat(); Floattostr limits precision to 15 digits (40734.8256689120). When updating the mysql database it converts the float to a string and looses the last 2 digits. The last digits are returned by

Re: RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Andrew Brunner
On Mon, Jul 11, 2011 at 10:19 AM, Hans-Peter Diettrich It doesn't make sense to display more digits than stored in the binary variable. There is no loss, only rounding errors in the conversion from binary to decimal text. I need to compare values with complete precision. I don't think this

RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Ludo Brands
You need to get the gnu binutils from sunfreeware.com and set your path to include /usr/local/bin. I have them installed. (Well, using 'pkg install gnu-binutils') Or else gld wouldn't be available at all. And there is no '/usr/local/bin'? Do you think I can better try the binutils

Re: [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Joost van der Sluis
On Mon, 2011-07-11 at 16:47 +0200, Ludo Brands wrote: You need to get the gnu binutils from sunfreeware.com and set your path to include /usr/local/bin. I have them installed. (Well, using 'pkg install gnu-binutils') Or else gld wouldn't be available at all. And there is no

RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Ludo Brands
How do you get the 40734.825668912003 value? Fields.FieldByName(Value).AsFloat(); Floattostr limits precision to 15 digits (40734.8256689120). When updating the mysql database it converts the float to a string and looses the last 2 digits. The last digits are returned by gdb or

Re: RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Andrew Brunner
On Mon, Jul 11, 2011 at 10:14 AM, Ludo Brands ludo.bra...@free.fr wrote: So you're losing 2 bits in precision by truncating to 15 digits. Ok, so I'm going to go out on a limb here and propose the question: How to we fix this 2bit loser ;-) ___

RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Ludo Brands
It doesn't make sense to display more digits than stored in the binary variable. There is no loss, only rounding errors in the conversion from binary to decimal text. I need to compare values with complete precision. I don't think this problem was present a while ago. When the

RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Ludo Brands
Application name is test. (It's a hello world) /usr/bin/gld -s -L. -o test link.res result: /usr/bin/gld:built in linker script:21: syntax error If you add --verbose it'll print out the internal ld script. See what line 21 corresponds with. When I use this: (-T, not -st) /usr/bin/gld

Re: RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Hans-Peter Diettrich
Andrew Brunner schrieb: It doesn't make sense to display more digits than stored in the binary variable. There is no loss, only rounding errors in the conversion from binary to decimal text. I need to compare values with complete precision. I don't think this problem was present a while ago.

Re: [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Joost van der Sluis
On Mon, 2011-07-11 at 18:08 +0200, Ludo Brands wrote: Application name is test. (It's a hello world) /usr/bin/gld -s -L. -o test link.res result: /usr/bin/gld:built in linker script:21: syntax error If you add --verbose it'll print out the internal ld script. See what line 21

RE : RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Ludo Brands
If you add --verbose it'll print out the internal ld script. See what line 21 corresponds with. I've attached the internal script for the gnu ld 2.21.1 on Solaris 10. Try /usr/bin/gld -s -L. -o test -T ld_internal_script link.res Ludo ld_internal_script Description: Binary data

Re: RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Joost van der Sluis
On Mon, 2011-07-11 at 18:29 +0200, Ludo Brands wrote: If you add --verbose it'll print out the internal ld script. See what line 21 corresponds with. I've attached the internal script for the gnu ld 2.21.1 on Solaris 10. Try /usr/bin/gld -s -L. -o test -T ld_internal_script

Re: RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Andrew Brunner
On Mon, Jul 11, 2011 at 11:55 AM, Hans-Peter Diettrich drdiettri...@aol.com wrote: The binary value consists of an exponent and an significand (mantissa), most probably you forgot to count the exponent and sign bits. The problem I'm trying to describe is with double precision floating point

RE : RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Ludo Brands
I'll use this script for now, thanks for the help. But I still wonder why it doesn't work by default... Probably the bug you mentioned in the other URL. Here's another report of exactly the same problem: http://permalink.gmane.org/gmane.comp.lang.lua.general/79592 Ludo

RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Ludo Brands
I could understand if you wanted to bring this fact into argument over arithmetic and cumulative error. But the fact is - if I send a double precision data value to a double precision field in the SQL database - that value had better be the same - bit for bit. Now if someone is being bit

Re: RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Andrew Brunner
On Mon, Jul 11, 2011 at 12:55 PM, Ludo Brands ludo.bra...@free.fr wrote: The only way to transfer double as binary data to the server is by using prepared statements and bound parameters. This is currently not implemented in fcl. All data are transferred as text to the database and are subject

RE : RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Ludo Brands
Hmmm... I seem to recall prepare and bind parameters in fcl-db/mySQL component source?. Are you sure about this? I really, really, really need double precision data to work. I know i've used binary binds with Int64 arrays and things well beyond 8 bytes binary.

Re: RE : RE : RE : RE : [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Michael Van Canneyt
On Mon, 11 Jul 2011, Ludo Brands wrote: Hmmm... I seem to recall prepare and bind parameters in fcl-db/mySQL component source?. Are you sure about this? I really, really, really need double precision data to work. I know i've used binary binds with Int64 arrays and things well beyond 8

Re: RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Mark Morgan Lloyd
Joost van der Sluis wrote: On Mon, 2011-07-11 at 18:29 +0200, Ludo Brands wrote: If you add --verbose it'll print out the internal ld script. See what line 21 corresponds with. I've attached the internal script for the gnu ld 2.21.1 on Solaris 10. Try /usr/bin/gld -s -L. -o test -T

Re: RE : [fpc-devel] Getting fpc to work on Solaris (11)

2011-07-11 Thread Joost van der Sluis
On Mon, 2011-07-11 at 19:59 +, Mark Morgan Lloyd wrote: Joost van der Sluis wrote: On Mon, 2011-07-11 at 18:29 +0200, Ludo Brands wrote: If you add --verbose it'll print out the internal ld script. See what line 21 corresponds with. I've attached the internal script for the gnu

Re: [fpc-devel] MySQL 5.1 and Double (trouble)

2011-07-11 Thread Martin Schreiber
On Monday 11 July 2011 19:55:25 Ludo Brands wrote: I don't think zeoslib uses prepared statements for mysql either. MSEgui tmysqlconnection uses prepared statements and binary parameters. Martin ___ fpc-devel maillist -