Search found 6758 matches

by dodicat
Mar 03, 2021 14:28
Forum: General
Topic: square root a la lanczos
Replies: 8
Views: 146

Re: square root a la lanczos

My solution was minimax. Here is another expanded version, minimax via Chebyshev. Sub GaussJordan(matrix() As Double,rhs() As Double,ans() As Double) Dim As Long n=Ubound(matrix,1) Redim ans(0):Redim ans(1 To n) Dim As Double b(1 To n,1 To n),r(1 To n) For c As Long=1 To n 'take copies r(c)=rhs(c) F...
by dodicat
Mar 03, 2021 9:14
Forum: General
Topic: square root a la lanczos
Replies: 8
Views: 146

Re: square root a la lanczos

From the LolRemez thread https://www.freebasic.net/forum/viewtopic.php?f=7&t=25897&p=275050&hilit=%2Apoly#p275050 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...
by dodicat
Mar 02, 2021 20:25
Forum: General
Topic: Pentacles
Replies: 63
Views: 3361

Re: Pentacles

I can Compress and Uncompress my nodes. So there, I am not frightened to utter these words, HA HA If the mods don't like it then tough! Dim As Integer xres,yres Screeninfo xres,yres screenres .9*xres,.9*yres Screeninfo xres,yres width xres\8,yres\16 screencontrol 100,5,5 #define map(a,b,x,c,d) ((d)-...
by dodicat
Mar 01, 2021 11:48
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 410

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

Hi SARG.
It doesn't fail with a variable.

Code: Select all

var elements = 100000000

Dim shared As long longvar(elements)
Dim shared As integer intvar(elements)
Dim shared As longint longintvar(elements)
print elements
sleep
 

Only the literals.
by dodicat
Mar 01, 2021 9:19
Forum: General
Topic: How to store Erfn() into a string variable
Replies: 10
Views: 191

Re: How to store Erfn() into a string variable

You should give the string some buffer to work with. dim as string errorf=string(10,0) I tried giving it more room using string*100 before and didn't work. Your suggestion is actually worse. I haven't seen that format before. Here this is the only thing to work consistently with -exx 32bit gas and ...
by dodicat
Mar 01, 2021 8:44
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 410

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

Here the literals fail on 64 bit fbc, gas or gcc unoptimized, with or without -exx.
I haven't looked at the output .c or .asm files yet.
Win 10 64 bit system, and the latest official fbc.
by dodicat
Feb 28, 2021 23:25
Forum: General
Topic: How to store Erfn() into a string variable
Replies: 10
Views: 191

Re: How to store Erfn() into a string variable

You should give the string some buffer to work with.
dim as string errorf=string(10,0)
by dodicat
Feb 28, 2021 23:10
Forum: Beginners
Topic: byref compiler error
Replies: 2
Views: 47

Re: byref compiler error

You must use byref in your declaration also.
by dodicat
Feb 28, 2021 23:03
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 410

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 but a variable is OK var elements = 100000000 Dim shared As long lon...
by dodicat
Feb 28, 2021 16:10
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 410

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

Looks like there is no way to use [U]integer everywhere or [U]long everywhere to satisfy 32 and 64 bits. In 64 bits ulong is needed for 32 bit colours, so Uinteger is out. In 64 bits integer is needed for screeninfo e.t.c. so long is out. There seems to be a bug If I try to use long and cast to inte...
by dodicat
Feb 28, 2021 8:39
Forum: Beginners
Topic: Integer data types in 32-bit and 64-bit
Replies: 20
Views: 410

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

Integer is still required for retrieved info from screeninfo , imageinfo , screencontrol in 64 bits.
But you will get an error message if you use long, so just change to integer for these things.
by dodicat
Feb 27, 2021 19:34
Forum: Beginners
Topic: Convert vbscript to FB
Replies: 10
Views: 635

Re: Convert vbscript to FB

You have defined unicode so .lpszClassName is wstring ptr. #define UNICODE #include once "windows.bi" #include once "/win/commctrl.bi" Dim Shared As HWND InputBoxWindow, EditBox, Button Dim Shared As WString * 255 TextMessage = "Type text here" Function WndProc(hWnd As ...
by dodicat
Feb 26, 2021 13:42
Forum: Community Discussion
Topic: Ansi, Utf8 & Utf16 encoding problems
Replies: 35
Views: 683

Re: Ansi, Utf8 & Utf16 encoding problems

I have used consolas as default. #include "windows.bi" Shell "color f0" Sub changefontsize(w As Long, h As Long,ftype As String="consolas") Dim As _CONSOLE_FONT_INFOEX x With x .cbsize=Sizeof(_CONSOLE_FONT_INFOEX) .nfont=0 .dwfontsize=Type(w,h) .fontfamily=0 .fontweight...
by dodicat
Feb 25, 2021 19:03
Forum: Beginners
Topic: Purpose of Syntax declares in language documentation
Replies: 6
Views: 152

Re: Purpose of Syntax declares in language documentation

The example shows you how to use chr, you certainly don't write declare function Chr ( byval ch as integer [, ... ] ) as string anywhere. Perhaps what it doesn't tell you that you are only allowed 32 entries. var s= chr(48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48...
by dodicat
Feb 24, 2021 18:57
Forum: General
Topic: Dodicat Zlib
Replies: 29
Views: 1015

Re: Dodicat Zlib

Hi Albert. I had to get one of my little dogs put to sleep today, she was very ill with kidney disease. That's only five years since my little hound died. I had taken her on when her owner died three years ago, she was quite an old dog then, about 11.5 years old. This meant that she stayed on in her...

Go to advanced search