Search found 1496 matches

by jj2007
Jul 23, 2020 0:53
Forum: Beginners
Topic: Automatic set ERR for error
Replies: 16
Views: 487

Re: Automatic set ERR for error

⋅ An overflow returns inf -> no problem. ⋅ The numerical value of blabla is zero -> no problem. ⋅ When values like 1e-48 and 9e-48 should get sorted, the user should get informed that this is not possible. This is the serious issue. CONST AS DOUBLE _ MinN = 1.401298e-4...
by jj2007
Jul 22, 2020 19:17
Forum: General
Topic: simple database/info storage idea ? possibly?
Replies: 9
Views: 300

Re: simple database/info storage idea ? possibly?

Hi veltesian, It's good to see that you are full of enthusiasm to learn FreeBasic. However, - there is a help file at FreeBasic\Help\FB-manual-1.05.0.chm - when you post code, don't expect that people understand what you intended! Therefore - post complete code, so that we can at least paste it into...
by jj2007
Jul 22, 2020 19:02
Forum: Beginners
Topic: Automatic set ERR for error
Replies: 16
Views: 487

Re: Automatic set ERR for error

Test 1e-48 . Yep, that's not a valid single, strictly speaking. But a reasonable language would simply return zero instead of making a fuss about it (and that's what FB does btw). However, the real problem here is that Err () is not being set for serious errors, such as an overflow or a blabla text...
by jj2007
Jul 22, 2020 12:48
Forum: Beginners
Topic: Automatic set ERR for error
Replies: 16
Views: 487

Re: Automatic set ERR for error

Hi mere mortal from the Eternal City. The task is checking if the input is a valid SINGLE value. Just try 1e-40 in your code. The task as defined by OP was not to check if the input was a valid single value. Besides, 1e-40 is a valid single value. The problem is another one: FreeBasic does not chec...
by jj2007
Jul 22, 2020 10:58
Forum: Beginners
Topic: Automatic set ERR for error
Replies: 16
Views: 487

Re: Automatic set ERR for error

Explain to us mere mortals, great guru from the Austrian Alpes, why your solution is better than mine... #define MinNumber -123 #define MaxNumber 123 Dim Number as double 'could use double Do input "Number is = "; Number If Number>=MinNumber and Number<=MaxNumber and Err()=0 then Exit do p...
by jj2007
Jul 22, 2020 8:45
Forum: Beginners
Topic: Automatic set ERR for error
Replies: 16
Views: 487

Re: Automatic set ERR for error

I believe my version uses less code and runs faster. #define MinNumber -123 #define MaxNumber 123 Dim Number as single 'could use double Do input "Number is = "; Number If Number>=MinNumber and Number<=MaxNumber and Err()=0 then Exit do print "Your number must be in the range ";...
by jj2007
Jul 18, 2020 8:58
Forum: General
Topic: Fast random numbers
Replies: 7
Views: 315

Re: Fast random numbers

David, In the meantime I checked it and it is indeed a factor 10 faster - with Gas. When using Gcc I get your values, roughly a factor 1.8. So I could fire back the question: Why on Earth is PCG32II soooo slow with Gas? ;-) Jokes apart: Earlier I had written that there is a factor 4 between the two ...
by jj2007
Jul 18, 2020 4:53
Forum: General
Topic: Oh no, not another PRNG
Replies: 80
Views: 2174

Re: Oh no, not another PRNG

deltarho[1859] wrote:Come to think of it your "almost 4 times as fast as PCG32" generator may do for our graphic's programmers using random numbers. Start a new thread introducing your generator.
Here it is
by jj2007
Jul 18, 2020 4:51
Forum: General
Topic: Fast random numbers
Replies: 7
Views: 315

Fast random numbers

Following an exchange of ideas with deltarho[1859] , here is MasmBasic Rand() for FreeBasic: Dim MyArray as Long ptr=MbRand(#elements, seed) Full example: #define iterations 20000000 #Include "Windows.bi" ' needed for HeapFree #inclib "MbRand" ' link with MbRand.lib; download fro...
by jj2007
Jul 17, 2020 22:00
Forum: Libraries
Topic: Static linking
Replies: 1
Views: 146

Static linking

What's wrong here? Why do I get "error: undefined reference to `MBRAND@8'"? With C, the library works fine... #Include "PCG32II.bas" #inclib "MbRand" ' MbRand.a is a Windows *.lib file Dim As pcg32 pcg Dim As ULong i Print "Rand" For i = 1 To 6 Print pcg.rand ...
by jj2007
Jul 17, 2020 19:28
Forum: Beginners
Topic: TSNE problem.
Replies: 14
Views: 495

Re: TSNE problem.

Phil, That should work fine in a loop. When you print the URLs before your DownloadOK=URLDownloadToFileA(0, szUrl, destFile, 0, 0) , do they all look ok? Can you post your code? Btw the "Suspicious pointer assignment" is just a warning, you can ignore it. FB and WinAPI don't understand eac...
by jj2007
Jul 17, 2020 12:13
Forum: General
Topic: Oh no, not another PRNG
Replies: 80
Views: 2174

Re: Oh no, not another PRNG

No, I won't touch that can of worms. Don Quixote against the 32-bit World ;-)
by jj2007
Jul 17, 2020 10:43
Forum: General
Topic: Oh no, not another PRNG
Replies: 80
Views: 2174

Re: Oh no, not another PRNG

Jochen, there is no logical flaw. The ENT suite, for the first four metrics, does not tell us whether we have a good RNG or not - it only tells us when we haven't. Me: For the ENT suite, it's a really good RNG You: No, it isn't because it failed PractRand You: ENT thinks it's a good RNG, but EN...
by jj2007
Jul 17, 2020 8:24
Forum: General
Topic: Oh no, not another PRNG
Replies: 80
Views: 2174

Re: Oh no, not another PRNG

David, You are right in all points, and I don't want to argue with our top expert about top quality randomness. My only point here was this one: Me: For the ENT suite, it's a really good RNG You: No, it isn't because it failed PractRand Can you see the logical flaw? If you had written "It's not...
by jj2007
Jul 17, 2020 0:30
Forum: General
Topic: Oh no, not another PRNG
Replies: 80
Views: 2174

Re: Oh no, not another PRNG

For the ENT suite, it's a really good PRNG No, it isn't because it failed PractRand at 128KB. No doubt it was doing quite well on the distribution uniformity tests but went down on the randomness tests. I wrote explicitly "for the ENT suite". And for that suite, my values are really not s...

Go to advanced search