[fpc-pascal] Variants and Extended

2009-09-17 Thread Torsten Bonde Christiansen
Dear list. Over the last couple of days i've been trying out different things with variants, but I always seem to end up in the same situation: When working with conversion between Extended and Variant, a small part of the precision in the Extended is lost. This would normally not pose an is

Re: [fpc-pascal] Variants and Extended

2009-09-17 Thread Torsten Bonde Christiansen
DOH! Forgot the example: procedure TForm1.Button1Click(Sender: TObject); var v: variant; x, y: extended; begin

Re: [fpc-pascal] Variants and Extended

2009-09-17 Thread Michael Van Canneyt
On Thu, 17 Sep 2009, Torsten Bonde Christiansen wrote: Dear list. Over the last couple of days i've been trying out different things with variants, but I always seem to end up in the same situation: When working with conversion between Extended and Variant, a small part of the precision in

Re: [fpc-pascal] Variants and Extended

2009-09-17 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: > > a specific extended version, data is copied into a double type. > > > > Not knowing much about the inner working of variants I don't know the > > reason > > for this, is it a bug or does the extended type not work inside the > > TVarData? >

Re: [fpc-pascal] Variants and Extended

2009-09-17 Thread Torsten Bonde Christiansen
Marco van de Voort wrote: Note that extended is x86 specific, and windows has been multi-architecture since the early nineties. Does this also mean that Extended does not work on MAC PowerPC? -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.

Re: [fpc-pascal] Variants and Extended

2009-09-17 Thread Vincent Snijders
Torsten Bonde Christiansen schreef: Marco van de Voort wrote: Note that extended is x86 specific, and windows has been multi-architecture since the early nineties. Does this also mean that Extended does not work on MAC PowerPC? It compiles, but it is only 64 bits, like a double. type

Re: [fpc-pascal] Variants and Extended

2009-09-17 Thread Torsten Bonde Christiansen
Ok, Thanks for the answer. -Torsten. It compiles, but it is only 64 bits, like a double. type extended = double; You can check this at compile time by doing {$IFDEF FPC_HAS_TYPE_EXTENDED} Vincent ___ fpc-pascal maillist - fpc-pascal@lists.freep

[fpc-pascal] getting started with threads

2009-09-17 Thread David Emerson
I am getting started with threads (linux/cthreads) and I'm very happy so far, but unsure of the best way to tackle my situation. I have a program that needs to perform about 10,000 independent tasks, which usually involve waiting for I/O; thus it makes sense to use several threads so that some

Re: [fpc-pascal] getting started with threads

2009-09-17 Thread Mark Emerson
Nice to see you posted this. Love, Dad On Thursday 17 September 2009 06:07:48 pm David Emerson wrote: > I am getting started with threads (linux/cthreads) and I'm very happy so > far, but unsure of the best way to tackle my situation. > > I have a program that needs to perform about 10,000 indepe

[fpc-pascal] apology

2009-09-17 Thread Mark Emerson
I apologize for accidentally posting a personal note to this list. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: getting started with threads

2009-09-17 Thread Tobias Giesen
> But how can I prevent race conditions? If threads X and Y happen to > call the task assignment function at the same time, it seems to me > that they could both be assigned to the same task. Use for example the cross-platform implementations of Enter/LeaveCriticalSection. Like this: EnterCri