Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 25.08.2017 01:33 schrieb "Ralf Quint" : > > On 8/24/2017 2:45 PM, Ched wrote: > > And under "modern" Windows, the extended type, which is fully > > supported by the FPU, is *degraded* to double. So, I can't do high > > precision computation with fpc even if the native hardware permits > > such c

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Ralf Quint
On 8/24/2017 2:45 PM, Ched wrote: > And under "modern" Windows, the extended type, which is fully > supported by the FPU, is *degraded* to double. So, I can't do high > precision computation with fpc even if the native hardware permits > such computations. I'm glued to XP as the full capabilities o

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 24.08.2017 23:46 schrieb "Ched" < charles.edouard.des.vastes.vig...@gmail.com>: > > And under "modern" Windows, the extended type, which is fully supported by the FPU, is *degraded* to double. So, I can't do high precision computation with fpc even if the native hardware permits such computation

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Ched
And under "modern" Windows, the extended type, which is fully supported by the FPU, is *degraded* to double. So, I can't do high precision computation with fpc even if the native hardware permits such computations. I'm glued to XP as the full capabilities of the FPU were on the hands of programme

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Bernd Oppolzer
Am 24.08.2017 um 14:00 schrieb James Richters: Thanks everyone for the explanation and solutions.  I can work around it well enough now that I understand what’s happening, but I’m still curious if there is a way to define fixed point variables?  In a C++ Project I was helping with recently, t

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Bernd Oppolzer
Am 24.08.2017 um 15:02 schrieb el es: On 24/08/17 13:26, Sven Barth via fpc-pascal wrote: [...] Note: FPC (and Delphi) has a single fixed point type which is Currency. AFAIK it uses four digits after the comma and 28 in front of it. Regards, Sven There was a project I remember, that I was to

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Tomas Hajny
On Thu, August 24, 2017 22:25, Ralf Quint wrote: > On 8/24/2017 2:18 AM, Sven Barth via fpc-pascal wrote: >> >> Am 23.08.2017 02:16 schrieb "Paul Nance" > >: >> > >> > Turbo Pascal also had a BCD unit. >> >> Free Pascal also has a BCD unit: FmtBCD. It provides a BCD type a

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Ralf Quint
On 8/24/2017 2:18 AM, Sven Barth via fpc-pascal wrote: > > Am 23.08.2017 02:16 schrieb "Paul Nance" >: > > > > Turbo Pascal also had a BCD unit. > > Free Pascal also has a BCD unit: FmtBCD. It provides a BCD type and > operators as well operator overloads. > And where wou

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Peter
FPC has a header for the GMP library. Regards, Peter B ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] ExtractRelativePath() not always returning expected result

2017-08-24 Thread James Richters
>Can you please file a bugreport for that, so I will not forget it ? Done. >The default for the OS is used; This is by design. That makes sense for most cases but is there / could there be a way to override this? I normally write programs for Windows, however I've had to write out the Linux Sl

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread el es
On 24/08/17 13:26, Sven Barth via fpc-pascal wrote: [...] > > Note: FPC (and Delphi) has a single fixed point type which is > Currency. AFAIK it uses four digits after the comma and 28 in front > of it. > > Regards, Sven > There was a project I remember, that I was told, for some e.g. tax purpo

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 24.08.2017 14:00 schrieb "James Richters" : > > Thanks everyone for the explanation and solutions. I can work around it well enough now that I understand what’s happening, but I’m still curious if there is a way to define fixed point variables? In a C++ Project I was helping with recently, the

Re: [fpc-pascal] ExtractRelativePath() not always returning expected result

2017-08-24 Thread Michael Van Canneyt
On Thu, 24 Aug 2017, James Richters wrote: You must make sure directories are appended with / Thank you, I just tried that and now I get the expected results: both / and \ work From "/pp/src/compiler/" to "/pp/bin/win32/ppc386/" via "..\..\bin\win32\ppc386\" From "/pp/bin/win32/ppc386/

Re: [fpc-pascal] ExtractRelativePath() not always returning expected result

2017-08-24 Thread James Richters
>You must make sure directories are appended with / Thank you, I just tried that and now I get the expected results: both / and \ work From "/pp/src/compiler/" to "/pp/bin/win32/ppc386/" via "..\..\bin\win32\ppc386\" From "/pp/bin/win32/ppc386/" to "/pp/src/compiler/" via "..\..\..\src\compi

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread James Richters
Thanks everyone for the explanation and solutions. I can work around it well enough now that I understand what’s happening, but I’m still curious if there is a way to define fixed point variables? In a C++ Project I was helping with recently, they had a way of defining a variable as having 2 p

Re: [fpc-pascal] ExtractRelativePath() not always returning expected result

2017-08-24 Thread Michael Van Canneyt
On Thu, 24 Aug 2017, James Richters wrote: I’m trying to figure out ExtractRelativePath() and I’ve run the sample program found here: https://www.freepascal.org/docs-html/rtl/sysutils/extractrelativepath.html I get the following results from the sample (with a few test I threw in myself):

[fpc-pascal] ExtractRelativePath() not always returning expected result

2017-08-24 Thread James Richters
I’m trying to figure out ExtractRelativePath() and I’ve run the sample program found here: https://www.freepascal.org/docs-html/rtl/sysutils/extractrelativepath.html I get the following results from the sample (with a few test I threw in myself): >From "/pp/src/compiler" to "/pp/bin/win32/pp

Re: [fpc-pascal] Inline ASM code

2017-08-24 Thread Karoly Balogh (Charlie/SGR)
Hi, On Thu, 24 Aug 2017, LacaK wrote: > Thank you! > I have hoped, that there is some kind of direct usage. Because > "fstp a" is compiled into: >fstps -0x24(%ebp) // address of local variable "a" on stack > and "pa^ := a" into: >mov-0x4(%ebp),%eax >mov-0x40(%eax),%edx // p

Re: [fpc-pascal] Inline ASM code

2017-08-24 Thread LacaK
> I need store result of floating point calculation (in my example arctan()) in memory pointed by some variable. See this code: > var a: single; pa: PSingle; > asm > fild dy > fild dx > fpatan > fstp a > fwait > end; > pa^ := a; > > It works, but is there any

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 23.08.2017 02:16 schrieb "Paul Nance" : > > Turbo Pascal also had a BCD unit. Free Pascal also has a BCD unit: FmtBCD. It provides a BCD type and operators as well operator overloads. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepas

Re: [fpc-pascal] Inline ASM code

2017-08-24 Thread Sven Barth via fpc-pascal
Am 24.08.2017 08:32 schrieb "LacaK" : > > Hi *, > > I need store result of floating point calculation (in my example arctan()) in memory pointed by some variable. See this code: > var a: single; pa: PSingle; > asm > fild dy > fild dx > fpatan > fstp a > fwait > end

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-24 Thread Martok
> It is perfectly predictable. Just do not store invalid values in enumeration > variables. And invalid > is everything not being declared. This is how FPC works and will work. Aye. The point being, if the store operation is in a library (a getter, such as mpfr_get_default_rounding_mode), there is