mpdecimal for Windows
mpdecimal for Windows
I built the Windows libraries of mpdecimal for anyone interested
Last edited by srvaldez on Oct 31, 2021 12:03, edited 2 times in total.
-
- Posts: 4308
- Joined: Jan 02, 2017 0:34
- Location: UK
- Contact:
Re: mpdecimal for Windows
I had a bit of a struggle to get the required files into a folder so that FB could find them. Anyway, I got there.
FB hasn't got a log base 10 but there is an example in the manual to achieve that and I got log base 10 of 8 as 0.9030899869919434.
and we can have arbitrary precision?
I expected mpDecimal-test.exe to take a while but it came in faster than I can blink.
WOW! The mind boggles.
Well done, srvaldez.
FB hasn't got a log base 10 but there is an example in the manual to achieve that and I got log base 10 of 8 as 0.9030899869919434.
Code: Select all
The 'ke!san Online Calculator' gave me 0.9030899869919435856412
Your build (50 sig figs) gave me 0.90308998699194358564121668417347908030456964438633
I expected mpDecimal-test.exe to take a while but it came in faster than I can blink.
WOW! The mind boggles.
Well done, srvaldez.
Re: mpdecimal for Windows
@deltarho[1859]
thank you for testing :smile:
thank you for testing :smile:
Re: mpdecimal for Windows
Just downloaded. Not yet tested ...
The web site for mpdecimal is here:
http://www.bytereef.org/mpdecimal/index.html
EDIT. Tested now. The two demo programs work well. The DLL too, but the file name (libmpdec.so.2.5.0) cannot be modified.
The web site for mpdecimal is here:
http://www.bytereef.org/mpdecimal/index.html
EDIT. Tested now. The two demo programs work well. The DLL too, but the file name (libmpdec.so.2.5.0) cannot be modified.
Re: mpdecimal for Windows
Hi srvaldez
I keep going to your download link (Dark page with the filename at the top left), but I always get that little win 10 waiting circle going round and round.
Maybe it is because of the slow broadband connection here.
I'll keep trying.
I keep going to your download link (Dark page with the filename at the top left), but I always get that little win 10 waiting circle going round and round.
Maybe it is because of the slow broadband connection here.
I'll keep trying.
Re: mpdecimal for Windows
try again, I uploaded it to GitHub and updated the link
Re: mpdecimal for Windows
Thanks srvaldez.
I'll test it later.
deltarho[]
fb has log10
I also read this:
Benford’s Law,states that the fractional part of the logarithm of random data is uniformly distributed between 0 and 1.
So, for instance, in a set of figures taken from real life, 1 is by far the most common first digit.
This has a neat application in fraud detection, in that most people ignore Benford’s Law when making up figures, and create their first digits in equal numbers.
I'll test it later.
deltarho[]
fb has log10
Code: Select all
#include "crt.bi"
print log10f(8)
print log10(8)
sleep
Benford’s Law,states that the fractional part of the logarithm of random data is uniformly distributed between 0 and 1.
So, for instance, in a set of figures taken from real life, 1 is by far the most common first digit.
This has a neat application in fraud detection, in that most people ignore Benford’s Law when making up figures, and create their first digits in equal numbers.
-
- Posts: 4308
- Joined: Jan 02, 2017 0:34
- Location: UK
- Contact:
Re: mpdecimal for Windows
Thanks for that.dodicat wrote:fb has log10
Re: mpdecimal for Windows
Code: Select all
''=============================================================================
#include "mpdecimal.bi"
'we need to initialize mpd_context before including the overloded operators
Dim Shared As mpd_context_t mpd_context
mpd_init(@mpd_context, 8)
#include "mpdoverload.bi" 'mpdecimal overloaded operators
''=============================================================================
mpd_context.prec = 32
Dim As mpd summand, sum, n, ten
sum = 0
n = 0
ten = 10
Do ' Bellard's formula
sum += (-32/(4*n+1)-1/(4*n+3)+256/(10*n+1)-64/(10*n+3)-4/(10*n+5)-4/(10*n+7)+1/(10*n+9)) / (1024^n)
n += 1
summand = -(-32/(4*n+1)-1/(4*n+3)+256/(10*n+1)-64/(10*n+3)-4/(10*n+5)-4/(10*n+7)+1/(10*n+9)) / (1024^n)
sum += summand
n += 1
Loop While Abs(summand) > ten^(-mpd_context.prec)
sum /= 64
Print sum
Print "press any key to exit ";
Sleep
Re: mpdecimal for Windows
@hhr
nice example :-)
nice example :-)
-
- Posts: 17
- Joined: Jan 08, 2016 20:33
Re: mpdecimal for Windows
Does anyone have a copy of the Bi and DLL for this?
I'd love to have a copy if anyone can oblige.
Regards
Andrew
I'd love to have a copy if anyone can oblige.
Regards
Andrew
Re: mpdecimal for Windows
hi Andrew Lindsay
link above updated, try again
link above updated, try again
-
- Posts: 17
- Joined: Jan 08, 2016 20:33
Re: mpdecimal for Windows
Thanks, that’s greatly appreciated.