Search found 1650 matches

by deltarho[1859]
Feb 22, 2019 15:54
Forum: Beginners
Topic: Random numbers not the same
Replies: 18
Views: 300

Re: Random numbers not the same

It breaks the distribution of the shuffle if we disallow the possibility of Rnd=0 I would agree if that was true but we are not disallowing the possibility of Rnd = 0. With 'Swap a(n), a(range(n+1,Ubound(a)))' we get 'Swap a(n), a(n+1)' by allowing Rnd = 0. The issue with the original code is that ...
by deltarho[1859]
Feb 22, 2019 12:55
Forum: Beginners
Topic: Random numbers not the same
Replies: 18
Views: 300

Re: Random numbers not the same

@dodicat

No big deal but if Rnd = 0 in Sub shuffle then we get Swap a(n), a(n).

Instead of

Code: Select all

Swap a(n), a(range(n,Ubound(a)))

this should do it

Code: Select all

Swap a(n), a(range(n+1,Ubound(a)))
by deltarho[1859]
Feb 22, 2019 7:59
Forum: Beginners
Topic: Random numbers not the same
Replies: 18
Views: 300

Re: Random numbers not the same

I am looking at For k=1 to n Swap arr(k), arr(k + Int(Rnd * (n-k+1))) Next k When k = n we get Swap arr(n), Swap arr(n) This is not problematic and will have no noticeable impact on performance but, nonetheless, we are doing something when there is no need. So the For loop should be to n-1 and not n...
by deltarho[1859]
Feb 21, 2019 21:04
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)
Replies: 497
Views: 47086

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)

Wrong! When I looked at WinFBE32.exe I opened it via its location. I open WinFBE64.exe from an icon on the Start Menu. There shouldn't be a blind bit of difference - famous last words. So, I sent a shortcut to WinFBE64.exe to the desktop. Opening WinFBE64.exe via that saw the update check working. I...
by deltarho[1859]
Feb 21, 2019 14:37
Forum: Beginners
Topic: Random numbers not the same
Replies: 18
Views: 300

Re: Random numbers not the same

counting_pine wrote:,such a function is almost off-topic,

Agreed. I got side tracked by dodicat's post.
by deltarho[1859]
Feb 21, 2019 13:58
Forum: Beginners
Topic: Random numbers not the same
Replies: 18
Views: 300

Re: Random numbers not the same

I have mentioned this before - a 64 bit generator by Donald Knuth. Function GetSeed() As Ulongint Return (Cast( Ulongint, Rnd*(2^32) ) Shl 32) Or Cast( Ulongint, Rnd*(2^32) ) End Function Randomize , 5 : GetSeed ' Cryptographic seed Dim As Ulong i Dim As Ulongint Rand Dim As Double KnuthRnd Rand = G...
by deltarho[1859]
Feb 21, 2019 2:24
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)
Replies: 497
Views: 47086

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)

The modRoutines.inc source code is compiled into both WinFBE32.exe and WinFBE64.exe executables. and I will see if it is feasible for me to also include the source code int he WinFBE Suite download as well. If the first quote worked as intended then there is no need for the second quote unless you ...
by deltarho[1859]
Feb 20, 2019 23:19
Forum: Beginners
Topic: Random numbers not the same
Replies: 18
Views: 300

Re: Random numbers not the same

@dodicat Your code is only stopping a repeat of the last 'a' and not all the 'a's calculated so far. @counting_pine To cover all possible permutations of shuffling 20 elements ( ie 20! ) we need a random number generator with at least 64 seed bits and none of the FB generators have that. PCG32II has...
by deltarho[1859]
Feb 20, 2019 22:26
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)
Replies: 497
Views: 47086

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)

@PaulSquires I couldn't find "modRoutines.inc" so I used 'FileLocator Pro' and found it in 'WinFBE-1.9.0'. It is not in WinFBE_Suite. I downloaded 'WinFBE-1.9.0' just out of curiosty not long ago and noticed that the 'FreeBASIC-1.06.0' folder was not in there and did not bother to check an...
by deltarho[1859]
Feb 20, 2019 16:47
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)
Replies: 497
Views: 47086

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)

I need to look at the whole distribution now that the new FB 1.06 is released in order to ensure that the include files are still compatible with my files and Jose's WinFBX library code. It is never-ending. <smile> In the meantime I shall drop 8.1.0x64 into 1.90 and see what happens. [1] Thanks, Pa...
by deltarho[1859]
Feb 20, 2019 15:29
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 418

Re: Numerical optimizer

@dodicat BTW var n= &hffffffff has TypeOf giving Integer, which is signed, and why we get -1. var m = 4294967295 has TypeOf giving Uinteger. srvaldez's suffix suggestion is one way to but we have to remember to force the issue. Dim is KISS and does what it says on the box. Or click on the right ...
by deltarho[1859]
Feb 20, 2019 15:13
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 418

Re: Numerical optimizer

Perhaps there is an option to correct this, but I can't find it. I think that I have been here before but my memory is letting me down. #print is put into the compiler log file. In WinFBE the fastest way to get to that is via Ctrl F9. I hate accelerator keys, I can never remember them for all of th...
by deltarho[1859]
Feb 20, 2019 13:45
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)
Replies: 497
Views: 47086

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated January 22, 2019)

@PaulSquires

Paul, WinFBE Version 1.90 has returned to using gcc 4.8.2 in 64 bit again. WinFBE Version 1.87 is using gcc 8.1.0 in 64 bit correctly.

It is worth checking whether gcc 8.2.0 is available for us yet. I get the odd issue with 8.1.0 and revert to FB's default of 5.2.0.
by deltarho[1859]
Feb 20, 2019 13:18
Forum: Tips and Tricks
Topic: Numerical optimizer
Replies: 25
Views: 418

Re: Numerical optimizer

I have never got to grips with 'var' resulting in unpredictability so I never use it. If I remember correctly fxm does not use it either. I would rather 'Dim As Ulong n = &hffffffff, m = 4294967295 Having said that srvaldez's suggestion works. var n = &hfffffffful var m = 4294967295ul I have...

Go to advanced search