Re: [Videlibri-xidel] Trying to build a Linux Xidel binary on WSL2
Client for public libraries
Brought to you by:
benibela
|
From: Reino W. <rwi...@xs...> - 2025-01-04 11:13:01
|
Hello Benito,
On 2025-01-04T01:26:33+0100, Benito van der Zander <be...@be...>
wrote:
>> round-half-to-even("60",3)
> that is also deprecated, it should be
> round-half-to-even(xs:double("60"),3). if I ever make strict type
> checking the default, it won't work anymore
You've been saying this for quite some time now, so "if I ever" with a
big IF, I guess. :D
The origin of this issue btw comes from my hobbyproject; the extraction
and processing of video framerates:
$ xidel -se '
(
25,50,60,
25.000,50.000,60.000,
(24000,30000,60000) ! (. div 1001)
) ! round-half-to-even(string(.),3)
'
25
50
60
25
50
60
23.976
29.97
59.94
While on Windows (win64)...
>xidel -se ^"^
(^
25,50,60,^
25.000,50.000,60.000,^
(24000,30000,60000) ! (. div 1001)^
) ! round-half-to-even(string(.),3)^
"
25.000000000000007
50.000000000000014
60.000000000000014
25.000000000000007
50.000000000000014
60.000000000000014
23.976000000000006
29.970000000000006
59.94000000000001
string(.), because the origin of those values is always ordinary text,
thus strings.
>> I've done some more researching and I found out that it's probably a
>> win64 (x86_64) thing.
> win64 is different because FreePascal on win64 does not support 80-bit
> floats. Microsoft said 80-bit floats are deprecated, so
> the FreePascal developers removed them. I do not understand why FPC
> would do that, when the CPUs still supports 80-bit float.
Strange policy, just because Microsoft says so.
> [...]
> But in this case, it is fixable, [...].
I've noticed "fix round-half-to-even(xs:double('60'),3) on win64"...
https://sourceforge.net/p/videlibri/code/ci/6c475311957391d7693891cacb9aa62236d5a985
https://github.com/benibela/internettools/commit/c128e75c71e358beec18817510c0ef96e95aa7e4
However, I presume you don't consider this to be THE fix for this
issues, because a freshly compiled win64 binary still returns the same
output as shown above.
Btw, am I right in saying that -dUSE_PASDBLSTRUTILS isn't needed for
Linux at all?
> It already fails when calculating 10^-3 = 0.001.
>xidel -se "math:pow(10,-3)"
0.0010000000000000002
Confirmed. ;)
> Omg, I just used the FreePascal math functions for that. It should
> calculate 1/(10*(10*10)), but FreePascal calculates
> (1/10)*((1/10)*(1/10)).
You mean the earlier talked about...?
$ sudo apt install fp-units-math-3.2.2
$ sudo apt install fp-units-win-math-3.2.2
--
Reino
|