Search found 3464 matches

by srvaldez
Sep 20, 2024 17:26
Forum: Beginners
Topic: prime factorization(Solved)
Replies: 3
Views: 568

Re: prime factorization

there is libflint but it's a very complex library also there is libpari it's complex as well but to get a working example is not too complicated although it's not FB like but rather it's like calling the pari/gp calculator from FB if you are interested you can get the 64-bit dll plus a rough example...
by srvaldez
Sep 17, 2024 16:34
Forum: Community Discussion
Topic: FreeBASIC file paths
Replies: 24
Views: 2946

Re: FreeBASIC file paths

Berkeley
if you are so unhappy with the way FreeBAsic does things then why bother using it?
use a language that you like and be happy instead of complaining all the time
by srvaldez
Sep 17, 2024 14:36
Forum: Community Discussion
Topic: FreeBASIC 'destroys' Rust
Replies: 9
Views: 1022

Re: FreeBASIC 'destroys' Rust

I started to watch it but I couldn't stand his constant foul language 😒
by srvaldez
Sep 12, 2024 21:42
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

dodicat, is it like the following ?

Code: Select all

Dim As Double eps, Pi, x, y
x = 3
y = 1
Pi = x
eps = 1e-15

While (x > eps)
	x = x * y / ((y + 1) * 4)
	y += 2
	Pi += x / y
Wend

Print Pi
Sleep
by srvaldez
Sep 12, 2024 16:30
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

@dodicat
what algorithm for Pi did you use ?
by srvaldez
Sep 11, 2024 21:41
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

dodicat I was curious about the performance of your program vs mine, so I ran your program with Print pie(10002) your time 4.68 seconds mine was 4.53 seconds with -O2 but with -O3 the time was 2.73 seconds however if I change the compile command in your program to #cmdline "-arch native -gen cl...
by srvaldez
Sep 11, 2024 20:46
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

dodicat
your function agrees with that of mine, when set to 100 digits of precision it prints
3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214807461e+00000
relative error -3.788932442673339572 E-108
by srvaldez
Sep 11, 2024 19:57
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

🤣🤣🤣
by srvaldez
Sep 11, 2024 19:50
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

Ok, will change that
thanks dodicat for the debug session 😁
now the question is why the naked function didn't work for you 🤔
by srvaldez
Sep 11, 2024 19:44
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

Ok, last resort
here's the compiled executable https://u.pcloud.link/publink/show?code ... 2sAhGYURL7
be sure to check for viruses :D
I forgot to put a sleep at the end so run from the console
by srvaldez
Sep 11, 2024 19:38
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

compile the original file from the download using the CLI
I think that your editor is changing the text encoding and causing problems
by srvaldez
Sep 11, 2024 19:26
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

I just downloaded FB-1.10.1-mingw-w64 gcc 11.2.0 and had no problem, I am stumped, try the following and tell me what you get ? pie-"3.14159265358979323846264338327950288419716939937510582096978610" instead of ? pie my suspicion is that the conversion to string is not working right, my gue...
by srvaldez
Sep 11, 2024 19:09
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

dodicat
since the compile command is at the top of file via #cmdline I can discount that as the problem, what version of FB are you using?
by srvaldez
Sep 11, 2024 18:25
Forum: General
Topic: unexpected order of evaluation
Replies: 37
Views: 2622

Re: unexpected order of evaluation

also, in the arccot example function I used the non-overloaded multiply and divide so that I could limit the precision and speed things up
I implemented that trick in the fpatn function and for precision 2000 or greater it's significantly faster than without the trick