Re: [Gambas-user] Long C routine

2014-01-30 Thread Benoît Minisini
Le 31/01/2014 07:48, Benoît Minisini a écrit : > Le 31/01/2014 02:25, Emil Lenngren a écrit : >> How does your Gambas source code for the test look like? >> For the best speed when using JIT (Fast), you could try to use >> one-dimensional embedded arrays >> (http://gambasdoc.org/help/cat/arraydecl?

Re: [Gambas-user] Long C routine

2014-01-30 Thread Benoît Minisini
Le 31/01/2014 02:25, Emil Lenngren a écrit : > How does your Gambas source code for the test look like? > For the best speed when using JIT (Fast), you could try to use > one-dimensional embedded arrays (http://gambasdoc.org/help/cat/arraydecl?v3) > But then they must be fixed-sized... > > /Emil >

Re: [Gambas-user] Long C routine

2014-01-30 Thread Emil Lenngren
How does your Gambas source code for the test look like? For the best speed when using JIT (Fast), you could try to use one-dimensional embedded arrays (http://gambasdoc.org/help/cat/arraydecl?v3) But then they must be fixed-sized... /Emil 2014-01-31 Jussi Lahtinen > Did you make pre-run for J

Re: [Gambas-user] Long C routine

2014-01-30 Thread Jussi Lahtinen
Did you make pre-run for JIT benchmark? Otherwise first run is slower than subsequents... maybe it's insignificant. Perhaps this works: Pass callback function as an argument to your C lib (along with other arguments), and call it when some proportion of the work is done (example when variable i %

Re: [Gambas-user] Long C routine

2014-01-30 Thread martin p cristia
Just a FYI This is the benchmark result solving a ecuation system 1578 order ( 1.309.782.606 operations) Gambas 147 seg Gambas+Fast27 seg Gambas + C2 seg So I still need the C library giving signs of life -

Re: [Gambas-user] Long C routine

2014-01-30 Thread Jussi Lahtinen
> > Not backgroud, as the user cannot do much while that routine is working, > but I need the program look at least alive as Ubuntu blackens the window. > You can run it in background if you lock GUI (or at least buttons etc) and perhaps show progress bar etc. > Also, I read that in some cases

Re: [Gambas-user] Long C routine

2014-01-30 Thread Benoît Minisini
Le 30/01/2014 22:53, martin p cristia a écrit : >> So you need to run the routine as a background task? Try the Task class >> (there is an example of it in the Fractal example, IIRC). >> >> Regards, >> Tobi > Not backgroud, as the user cannot do much while that routine is working, > but I need the

Re: [Gambas-user] Long C routine

2014-01-30 Thread martin p cristia
> So you need to run the routine as a background task? Try the Task class > (there is an example of it in the Fractal example, IIRC). > > Regards, > Tobi Not backgroud, as the user cannot do much while that routine is working, but I need the program look at least alive as Ubuntu blackens the windo

Re: [Gambas-user] Possible bug in round() function

2014-01-30 Thread Benoît Minisini
Le 30/01/2014 11:33, Ricardo Díaz Martín a écrit : > Hi guys, > > Try to do this in the gambas console: > > ? round (283.5 * 0.21, -2) > 59,53 > > ? 283.5 * 0.21 > 59,535 > > ? round(59.535, -2) > 59,54 > > Why round (283.5 * 0.21, -2) doesn't works as expected? (or as I > expected...) > > I got th

Re: [Gambas-user] Possible bug in round() function

2014-01-30 Thread Jussi Lahtinen
> > I wouldn't say magical. Disillusioning maybe :-) > > 0.21 is not exactly representable with a finite number of bits. That's > why you should expect errors when computing with it. When you multiply, > the absolute error can get relatively large, obviously. > This probably has something to do wi

Re: [Gambas-user] Long C routine

2014-01-30 Thread Tobias Boege
On Thu, 30 Jan 2014, martin p cristia wrote: > Hi: > > I need a way to keep the GUI alive while processing a EXTERNAL C routine: > > Public Extern M8gauss(mfMatriz As Float[], vfX As Float[], vfTermns As > Float[], lOrder As Long) As Long > > wich is a Gaussian ecuations system solver, and can

[Gambas-user] Long C routine

2014-01-30 Thread martin p cristia
Hi: I need a way to keep the GUI alive while processing a EXTERNAL C routine: Public Extern M8gauss(mfMatriz As Float[], vfX As Float[], vfTermns As Float[], lOrder As Long) As Long wich is a Gaussian ecuations system solver, and can take up to 10minutes ( 10^10 aritmetic operations). Any hel

Re: [Gambas-user] Possible bug in round() function

2014-01-30 Thread Tobias Boege
On Thu, 30 Jan 2014, Bruce wrote: > On Thu, 2014-01-30 at 10:33 +, Ricardo D??az Mart??n wrote: > > ? round (283.5 * 0.21, -2) > > very interesting. The miracles we call floats. > try > ? round (283.46 * 0.20996, -2) > 59.54 > > Strange and magical, we'd be

Re: [Gambas-user] Possible bug in round() function

2014-01-30 Thread Bruce
On Thu, 2014-01-30 at 10:33 +, Ricardo Díaz Martín wrote: > ? round (283.5 * 0.21, -2) very interesting. The miracles we call floats. try ? round (283.46 * 0.20996, -2) 59.54 Strange and magical, we'd better wait on Benoit's call on this one. ? Bruce --

[Gambas-user] Possible bug in round() function

2014-01-30 Thread Ricardo Díaz Martín
Hi guys, Try to do this in the gambas console: ? round (283.5 * 0.21, -2) 59,53 ? 283.5 * 0.21 59,535 ? round(59.535, -2) 59,54 Why round (283.5 * 0.21, -2) doesn't works as expected? (or as I expected...) I got the same wrong behavior in my program using something like fAux = round(fNumber1,