Search found 2927 matches

by Richard
May 09, 2007 14:46
Forum: Documentation
Topic: Using ? instead of print
Replies: 7
Views: 3462

“?” has been a standard shorthand across all BASICs since before 1978. It was used mostly for questioning variable values while debugging with interpreters. Back then, no line number was interpreted as an immediate command. “?” is still used by some fb programmers in their code. Maybe, to satisfy an...
by Richard
May 09, 2007 6:18
Forum: Documentation
Topic: Using ? instead of print
Replies: 7
Views: 3462

Great manual! But in todays FreeBASIC manual the keyword index has an entry; “Operator ? (Concatenate and assign)” that leads to “&= Concatenate and assign” Presumably the ? should be replaced with &= There is no index entry to the “?” used as a shortcut for print, nor is there any mention u...
by Richard
May 06, 2007 16:41
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3143

Fractions were being considered in an attempt to exactly represent the real number in the memory. This was because many of the numbers used when testing a calculator are fractions. Unfortunately because many irrational numbers cannot be represented exactly as fractions, fractions became an unnecessa...
by Richard
May 05, 2007 22:44
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3143

If “What You See Is What You Get” is your aim then you are on a wild goose chase, you can never succeed. For example, it will never be possible to use or display Pi or the square root of two since neither of these can be represented exactly in any system considered so far in this thread. Engineering...
by Richard
May 05, 2007 13:47
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3143

I did not mean to scare you. If you always display your results with a fixed number of decimal places then you will not notice the variation in precision. Make the number of decimal places displayed fixed initially at say 2 or 4. You will only be aware of problems if you do not control the number of...
by Richard
May 05, 2007 10:17
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3143

The approximate 15 digit limit for double precision specifies the total number of significant digits displayed no matter where the decimal point lies. When you multiply or divide two numbers you retain the total of 15 digits through the calculation. If you add or subtract (as you are in the example)...
by Richard
May 04, 2007 23:55
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3143

With any advanced calculator you need to control the number of digits displayed and the rounding. Take a look at the “Format” and the “Print Using” commands. They will give you the features you need.
by Richard
May 03, 2007 3:33
Forum: General
Topic: Identification of source.BAS version.
Replies: 2
Views: 1099

Identification of source.BAS version.

I want to avoid having to guess and manually change the compiler command –lang option in my FBIde. I could invent a new extension for my modified QB4.5 sources and possibly yet another for new FB. This gets messy as .BAS is the default for all IDEs. I’d like to avoid that change. I could put a line ...
by Richard
May 02, 2007 20:32
Forum: General
Topic: Let's Have Some Fun
Replies: 52
Views: 9550

Randomize Timer:Dim As Double i=200,j,a=.2+2*Rnd,b=0.3+2*Rnd,c=-13-4*Rnd,x,y,xx,yy Screen 21:Window(-240,-i)-(i,i) a:For i=1 To 2e4:Pset(x+y,x-y),j:xx=y-Sgn(x)*Sqr(Abs(a*x-b)):yy=c-x:x=xx:y=yy:Next i j+=1:If j>15 Then j=0 If Inkey$ = "" Then...
by Richard
May 02, 2007 15:10
Forum: General
Topic: Let's Have Some Fun
Replies: 52
Views: 9550

Life is a game, the aim of which is to discover the rules of the game.
We now know the rules, what is the cool idea?
by Richard
Apr 30, 2007 10:36
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4317

There is no flaw in either code, you just moved the goal posts. You had not fully specified the problem. If the fence line has ends then your fence posts can mark them. The question that then rises is how to determine if the fence post is inside or outside the polygon. You have the maths needed to s...
by Richard
Apr 29, 2007 22:56
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4317

Holes in polygons are separate polygons themselves. Holes subtract from the outer polygon area.
Run the algorithm on the outer polygon, then run it again on the hole, using the same fence line. Subtract the hole areas from the outer areas. There you have it.
by Richard
Apr 29, 2007 22:45
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4317

Counting_pine wrote: I received no comments on it at all. I still don't understand why. Although you did post the first working solution to the problem, you received no comments when you originally posted your algorithm because no one trusted or understood how it worked. It was too advanced for the ...
by Richard
Apr 29, 2007 0:47
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4317

Once upon a time we would have cut the polygon out of sheet material, cut along the fence line and then weighed or compared the two parts on a beam balance. Counting pixels is quicker but not as fast and accurate as vector maths solutions which take on the order of 50 usec for this example. Interest...
by Richard
Apr 26, 2007 16:24
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4317

I have edited my code and documentation to fix and clean it up a bit. It also now plots the polygons. I would first like to thank duke4e and Sisophon2001 for their praise. Secondly I would not have done it if such an apparently simple problem had not been posed clearly. Luckily I needed something to...

Go to advanced search