Search found 1903 matches

by jj2007
Mar 03, 2021 17:44
Forum: Windows
Topic: Weird problem: CreateFile seems to return equal handles for different files
Replies: 2
Views: 68

Re: Weird problem: CreateFile seems to return equal handles for different files

As usual, opinions differ , marcov ;-) According to docs.microsoft... , converting from 32 to 64 bit handles involves sign-extending the value, so this means handles are NOT unsigned 64-bit versions of Windows use 32-bit handles for interoperability. When sharing a handle between 32-bit and 64-bit ...
by jj2007
Mar 03, 2021 17:32
Forum: General
Topic: square root a la lanczos
Replies: 8
Views: 160

Re: square root a la lanczos

Good idea, srvaldez: function sqrt(x as double) as double ' approximating sqr(x) [1 To 2] Return _ ((((((+0.00488320646279881)*x-0.04697287955202312)*x+0.1946001357427462)*x-0.4743301141755174)*x _ +1.028216061109412)*x _ +0.2936052298143235) end function Dim As Double y, sum Print " x sqrt(1+x...
by jj2007
Mar 03, 2021 16:04
Forum: General
Topic: square root a la lanczos
Replies: 8
Views: 160

Re: square root a la lanczos

dodicat wrote:From the LolRemez thread
Little speed test:

Code: Select all

... see below, 18:32 ...
by jj2007
Mar 03, 2021 12:38
Forum: Windows
Topic: Weird problem: CreateFile seems to return equal handles for different files
Replies: 2
Views: 68

Weird problem: CreateFile seems to return equal handles for different files

#include "Windows.bi" Dim As handle fh2, fh1 fh1=CreateFile("..\examples\unicode\hello_chinese.bas", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) Print "The handle #1: ", fh1 fh2=CreateFile("..\examples\unicode\hello_greek.bas"...
by jj2007
Mar 03, 2021 12:15
Forum: Documentation
Topic: String index doc
Replies: 42
Views: 778

Re: String index doc

4 operators which return by reference have in their documentation page a single syntax of 'Usage', which can be misleading for a novice (suggesting the only feature "get"). I know you all hate me by now, but I assure you that my intentions are good. A novice needs crystal clear examples, ...
by jj2007
Mar 02, 2021 21:06
Forum: Documentation
Topic: String index doc
Replies: 42
Views: 778

Re: String index doc

Now the other use - poke a new value into Hello W orld: asm int 3 r=&H77 ' use the reference to poke 77h into world asm int 3 a[6]=&H77 ' use the pointer to poke 77h into world asm int 3 int3 mov ecx, [local.5] ; ecx is a pointer ("reference") to "world" mov byte ptr [ecx...
by jj2007
Mar 02, 2021 20:51
Forum: Documentation
Topic: String index doc
Replies: 42
Views: 778

Re: String index doc

jj2007: again - if the other languages are so much better, if you don't like FB, why are you here? I like BASIC, and Free Basic is even better. I could pass back the question: if you are so fond of C++ concepts, why do you waste your time on a BASIC forum? Why are some people so eager to turn FreeB...
by jj2007
Mar 02, 2021 17:07
Forum: Documentation
Topic: String index doc
Replies: 42
Views: 778

Re: String index doc

a bunch of people that can't grasp what a reference is. So much discussion over such a trivial matter... Interesting that you start insulting other members of this forum - you've run out of arguments? As to "trivial matter": the first Google hit for reference pointer difference is a SOF p...
by jj2007
Mar 02, 2021 11:41
Forum: Documentation
Topic: String index doc
Replies: 42
Views: 778

Re: String index doc

Dim c As Integer=a[6] does not "return a reference", it returns a number (ubyte or ushort); and of course, it does so internally without making a copy. This is trivial, only a horribly inefficient compiler would create a copy to extract the byte... What bothers me here is not only the inco...
by jj2007
Mar 01, 2021 17:13
Forum: Documentation
Topic: String index doc
Replies: 42
Views: 778

Re: String index doc

'Returns a reference' is the right term because the 'Operator [] (String Index)' really returns by reference (see Syntax). Maybe it returns (arguably) something by reference, but it does not return a reference; it returns the numeric value of the char inside the string a at position n : Dim a As St...
by jj2007
Mar 01, 2021 6:41
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 415

Re: Integer data types in 32-bit and 64-bit

You have found a Windows 64 bit bug badidea. a literal crashes (no optimisations) Dim shared As long longvar( 100000000 ) Dim shared As integer intvar( 100000000 ) Dim shared As longint longintvar( 100000000 ) print 100000000 sleep Win7-64: ERROR_BAD_EXE_FORMAT for fbc64_gas64.exe -t 2000 -gen gas6...
by jj2007
Mar 01, 2021 5:45
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) WDS / LNX
Replies: 401
Views: 49882

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

161 ms time for what ? Sorry, I copied from the output window: my IDE measures the compile time, too - not interesting in this context. @jj2007 What do you want to prove ? that an alone guy in 2 years does less well than a very skilled team during many years ;-) You are doing fantastic work, SARG. ...
by jj2007
Feb 28, 2021 22:07
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 415

Re: Integer data types in 32-bit and 64-bit

I did some more tests with a bit modified code: #Define elements 100000000 '100M ... FreeBASIC 1.07.1 64-bit gcc on Linux Sum integer = 800010752 added in 343 ms Sum long = 800010752 added in 342 ms With 150 Million elements, FB64: Sum integer= 1199937252 added in 175 ms Sum long = 1199937252 added...
by jj2007
Feb 28, 2021 20:52
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) WDS / LNX
Replies: 401
Views: 49882

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

sizes in 64-bit code: 8 integer 4 long Fill array= 7752 Sum integer= 1199937252 added in 190 ms Sum long = 1199937252 added in 98 ms FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win64 (64bit) Copyright (C) 2004-2019 The FreeBASIC development team. standalone *** 161 ms for fbc.exe -g...
by jj2007
Feb 28, 2021 16:56
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 415

Re: Integer data types in 32-bit and 64-bit

dodicat wrote:In 64 bits integer is needed for screeninfo e.t.c. so long is out
I wonder if we really need 64 bits to calculate the screen resolution. With my current hardware, 16 bits are already generous for expressing my 1366 pixels of horizontal resolution ;-)

Go to advanced search