Flaming Thunder
News 
CD, by Stijn Hertelé
 
         
Carved Ellipsoid, by Hassan Sedaghat

13 May 2008: Fixed a bug that caused some programs to fail to compile if a function was used before it was defined. Programs such as the following should now compile and run correctly:

WriteLine abs(-10).

Abs  is a function(x) doing return sqrt(sqr(x)).
Sqr  is a function(x) doing return x*x.
Sqrt is a function(x) doing return squareroot(x).

12 May 2008: User-defined functions are in. Flaming Thunder supports recursive functions, nested functions, and functions can be declared after they are used (in case you would like to put your function definitions at the end of your program, glossary style).

The function name is the first word in the function declaration, so that if you put your functions in alphabetical order it is easy to look them up.

Small example showing all of the above:

WriteLine Factorial( 100 ).
WriteLine Distance( 1.0, 1.0, 1.0, 2.0, 2.0, 2.0 ).

Distance is a function(x1,x2,x3,y1,y2,y3) doing
  (
  Return squareroot( square(y1-x1)+square(y2-x2)+square(y3-x3) ).
  Square is a function(w) doing return w*w.
  ).
Factorial is a function(n) doing
  if n = 0 then return 1 else return n*factorial(n-1).

29 Apr 2008: High precison square roots are now in. For example, here's how to calculate phi (the golden ratio) to 1000 decimal digits:

Set realdecimaldigits to 1000.
Writeline (1+squareroot(5))/2.

27 Apr 2008: We eliminated the Student version and renamed the Professional version to the Full version. For everyone who purchased a Student subscription, we've upgraded it for free to a Full subscription. For everyone who purchased a Professional subscription, we've extended it for free to a lifetime Full subscription.

23 Apr 2008: There is now a workaround in DPGraph for a bug that a small number of keyboard drivers have, which caused graphs to continue moving after the arrow keys were released.

22 Apr 2008: Added two new functions: ByteCharacter and GetByteValue. ByteCharacter converts an integer from 0 to 255 into a string of length 1. GetByteValue does the opposite; it converts a string of length 1 into an integer from 0 to 255. ByteCharacter is handy for creating strings with non-printable characters in them. For example,

Write "Hello World!",ByteCharacter(13),ByteCharacter(10).
is equivalent to:
Write "Hello World!",CarriageReturn,Linefeed.
which on Windows machines, is equivalent to:
Writeline "Hello World!".
GetByteValue is handy for reading binary values stored in files. For example, if the file input.dat contains a single 2-byte binary number with the lowest-order byte stored first, then the following program shows one way to read the data and write its decimal value:
Read x from "input.dat".
Writeline       GetByteValue(Substring(x,1,1))
          + 256*GetByteValue(Substring(x,2,1)).

13 Apr 2008: Changed the names of the the routines ConvertStringToNumber, ConvertToString and FindString to Number, String and Find. The old names will continue to work in existing code.

9 Apr 2008: You can now set the approximation mode that Flaming Thunder uses for the real arithmetic operations +, -, * and /. The default mode is RoundToEven. Setting the number of real decimal digits also now words for +, -, * and / (see the note for 8 Apr 2008). The 12 real approximation modes are:

RoundAwayFromZero ("schoolbook" rounding)
RoundToEven (probably the best for most applications)
RoundToOdd
RoundTowardNegativeInfinity
RoundTowardPositiveInfinity
RoundTowardZero
TruncateAwayFromZero
TruncateToEven
TruncateToOdd
TruncateTowardNegativeInfinity
TruncateTowardPositiveInfinity
TruncateTowardZero

To set the real approximation mode:

Set RealApproximationMode to TruncateTowardZero.

For example, suppose you want to see if 7 decimal digits are enough to sum the harmonic series 1/1 + 1/2 + ... 1/1_000_000. After all, 1_000_000 has only a little more than 6 digits. Let's suppose you also want to see the range of values you can expect under worst case conditions (truncating high and low instead of rounding).

If you run the following program:

Set Sum to 0.0. # Start with defaults: 30 digits, round to even.
For n from 1 to 1_000_000 do set sum to sum + 1.0/n.

Writeline "30 digits, round to even = ", Sum.

Set RealDecimalDigits to 7. # Use 7 digits for the rest.

Set RealApproximationMode to TruncateTowardPositiveInfinity.
Set Sum to 0.0.
For n from 1 to 1_000_000 do set sum to sum + 1.0/n.

Writeline "7 digits, truncate up = ", Sum.

Set RealApproximationMode to RoundToEven.
Set Sum to 0.0.
For n from 1 to 1_000_000 do set sum to sum + 1.0/n.

Writeline "7 digits, round to even = ", Sum.

Set RealApproximationMode to TruncateTowardNegativeInfinity.
Set Sum to 0.0.
For n from 1 to 1_000_000 do set sum to sum + 1.0/n.

Writeline "7 digits, truncate down = ", Sum.

it will write the following output:

30 digits, round to even = 14.3927267228657236313811274295
7 digits, truncate up = 21.61167
7 digits, round to even = 13.05426
7 digits, truncate down = 11.72242

So, you can conclude that 7 digits probably aren't enough. If you change 7 to 10 in the above program and rerun it, it will write:

30 digits, round to even = 14.3927267228657236313811274295
10 digits, truncate up = 14.39768079
10 digits, round to even = 14.39272306
10 digits, truncate down = 14.38779239

So, you can conclude that 10 digits are much better than 7.

8 Apr 2008: You can now set the number of decimal digits to use for real arithmetic. The default number of digits is 30. This only works for division today (so divide by 1.0 at the end of your calculation, for example), but in a day or two will work for the other operations. For example, the program:

Set RealDecimalDigits to 10.
WriteLine 1.0/7.0.
Set RealDecimalDigits to 50.
WriteLine 1.0/49.0.

will write:

0.1428571428
0.020408163265306122448979591836734693877551020408163

6 Apr 2008: Lots of improvements to high precision real arithmetic. Routines that benefited the most are division, maximum, minimum and automatic conversion of integers and rationals where needed. The precision is currently set to about 50 digits for testing. In a day or two the precision will be user-settable, as will the rounding/truncation modes.

For an example, the program:

Set ESum to 0.0.
For n from 0 to 20 do set ESum to ESum + 1/n!.

Set PiSum to 0.0.
For n from 0 to 20 do set PiSum to PiSum + 4*(-1)^n/(2*n+1).

WriteLine "ESum is quickly converging to e:".
WriteLine ESum.
WriteLine "PiSum is slowly converging to pi:".
WriteLine PiSum.

will write:

ESum is quickly converging to e:
2.71828182845904523533978449066641588614640343454010753
PiSum is slowly converging to pi:
3.1891847822775947292439110471360943450813850069675

Notice how ESum and PiSum are initialized to real 0.0's instead of integer 0's. That forces the conversion of the sums to reals, otherwise Flaming Thunder would evaluate them exactly using arbitrary precision rational arithmetic (see the entry for 30 Mar 2008).

31 Mar 2008: Fixed a bug in error checking. Programs that check for errors (in numeric input, for example) using "is a", "is an", "is not a" or "is not an" will now work correctly:

Retry:
  Write "Please enter a number: ".
  Read inputstring.
  Set x to ConvertStringToNumber(inputstring).
  If x is an error then
    (
    WriteLine "Invalid number, the error message is: ", x.
    Go to retry.
    ).
  WriteLine "Three times your number is ", 3*x.

30 Mar 2008: Lots of improvements to exact arbitrary precision rational arithmetic. For example, here is a program that calculates rational approximations to e and pi by summing the first few terms of two infinite series (the series for e converges much more rapidly than the series for pi):

Set ESum to 0.
For n from 0 to 20 do set ESum to ESum + 1/n!.

Set PiSum to 0.
For n from 0 to 20 do set PiSum to PiSum + 4*(-1)^n/(2*n+1).

Writeline "e is approximately  ",ESum.
Writeline "pi is approximately  ",PiSum.

28 Mar 2008: ConvertStringToNumber(string) now supports real numbers. Numbers can be in ordinary decimal point point format such as 123.4456, or they can be in exponential format such as 112.3E-12.

27 Mar 2008: ConvertToString(parameter) and ConvertStringToNumber(string) are now in. ConvertStringToNumber supports only integers today; real numbers will be working in a day or two.

26 Mar 2008: GetTimeInSeconds() and GetGreenwichMeanTime() now work in Mac OS X 10.4 Tiger. For other developers who may be having similar problems: the Darwin gettimeofday system call number 116 sys_gettimeofday violates BSD calling conventions. It returns seconds in Eax and microseconds in Edx instead of returning them in the timeval structure.

26 Mar 2008: The GetTimeInSeconds() function is in. It returns a real number (for example, 12851007789.703125) which is the time in seconds since Jan 1, 1601. You can measure elapsed time by subtracting the time before a lengthy operation from the time after. The resolution depends on your operating system. There is a bug in Mac OS X 10.4 Tiger (and possibly other versions) which causes GetTimeInSeconds() to return an erroneous time; we are trying to come up with a workaround.

25 Mar 2008: Under FreeBSD, Linux and Mac OS X, changed the default permissions on files created by the Write To and WriteLine To procedures from 600 (readable/writeable only by the owner) to 644 (also readable by anyone else). This facilitates writing HTML pages on a server that are automatically readable on the web.

25 Mar 2008: As per the specifications, the CGI and environment variable functions are now only available in the Professional Edition.

24 Mar 2008: Created a Google Groups discussion forum for Flaming Thunder. Click on the Forum link in the menu.

24 Mar 2008: Fixed a rarely occuring bug in the Quotient, Remainder, Mod, LeastCommonMultiple and GreatestCommonDivisor functions that caused incorrect results for certain remainders.

22 Mar 2008: Easy file i/o is in. The statements are Remove, Read From, Write To, and WriteLine To. For example, a short program to create a new file and then copy two other files into it, is:

Remove "output.txt".
Read x from "input1.txt".
Read y from "input2.txt".
Write x,y to "output.txt".

Write To appends the data to the file, so another way to write the same program is:

Remove "output.txt".
Read x from "input1.txt".
Write x to "output.txt".
Read x from "input2.txt".
Write x to "output.txt".

WriteLine To works in the same way as Write To, except that it appends a newline to the end of each piece of data that it writes:

Remove "output.txt".
Writeline "This is the 1st line" to "output.txt".
Writeline "This is the 2nd line" to "output.txt".

20 Mar 2008: Fixed a problem in FTNotepad that sometimes caused the error "InitDialog_SetFocus 00000006" under Windows XP SP2.

19 Mar 2008: New functions: FindString, Substring and GetStringLength.

17 Mar 2008: New functions: LowercaseASCII and GetGreenwichMeanTime.

15 Mar 2008: Flaming Thunder now sets the owner-executable bit even if a previously existing file with the same name had the executable bit turned off.

15 Mar 2008: Flaming Thunder now sets the owner-executable bit on executable files created under FreeBSD, Linux and Mac OS X, if the file can be executed on the operating system that it was compiled under. For example, Flaming Thunder will not set the owner-executable bit on a FreeBSD program cross-compiled under Linux because Linux cannot execute it.

15 Mar 2008: Fixed a bug in FreeBSD executables.

14 Mar 2008: Happy Pi Day (3/14)!

Added routines to support easy CGI scripting: GetUndecodedCGIData, GetUndecodedCGIDataSize, GetDecodedCGIVariableCount, GetDecodedCGIVariableName, GetDecodedCGIVariableIndex, GetDecodedCGIVariableValue, GetDecodedCGIVariableFileCount, GetDecodedCGIVariableFileName and GetDecodedCGIVariableFileData.

GetUndecodedCGIDataSize allows you to check the size of the raw CGI data before processing any of it, so that, for example, you can reject unexpectedly large file transfers with the least amount of overhead.

GetUndecodedCGIData allows you to view the raw undecoded CGI data, which might be handy if a particular browser and/or server is causing the decode routines to fail. If that is the case, you should alert us so that we can update the decoding routines. So far we have tested the routines with the current versions of Internet Explorer, FireFox and Safari.

GetDecodedCGIVariableCount, GetDecodedCGIVariableName, GetDecodedCGIVariableIndex and GetDecodedCGIVariableValue allow you to process ordinary CGI variables.

GetDecodedCGIVariableFileCount, GetDecodedCGIVariableFileName and GetDecodedCGIVariableFileData allow you process type=file CGI variables.

5 Mar 2008: Fixed a bug in the 64-bit versions in adding floating point numbers that had certain negative differences between their exponents. Also, fixed a problem running the Professional Edition of FTNotepad on 32-bit systems.

3 Mar 2008: Added the Seive of Eratosthenes to the examples. Added some new functions: AbsoluteValue, GreatestCommonDivisor, LeastCommonMultiple, Quotient, Remainder, UppercaseASCII. Added two new operators: mod and divides. Mod and divides allow you write statements such as If x mod 7 = 5 then ... and If x divides y then ....

21 Feb 2008: Added examples to the documentation showing how to create several kinds of CGI scripts.

19 Feb 2008: Made an improvement in memory allocation under 64-bit Linux.

18 Feb 2008: Made an improvement in memory allocation under FreeBSD and Mac OS X.

16 Feb 2008: We released FTNotepad today – an easy-to-use version of Flaming Thunder for Windows users that you can run directly from the internet. We also added interval arithmetic so that you can let Flaming Thunder propagate imprecision in your inputs through a calculation and tell you how imprecise your results are.

13 Dec 2007: Large numbers (greater than about 5,000 digits for 32-bit versions and 10,000 digits for 64-bit versions) are now multiplied using an O(N log(N)) number theoretic transform. If you have enough memory, Flaming Thunder's triple-prime algorithm supports numbers of over 3 quintillion decimal digits. RAM manufacturers around the world are celebrating.

4 Dec 2007: First public Flaming Thunder release.


 
     
Home
Free version
Full version
Subscribe
List of site
subscribers
Specs
Docs
Forum
Contact
News
13 May 08
 
Graph credits: carved ellipsoid by Hassan Sedaghat, CD by Stijn Hertelé.
 
©2002-2008 Flaming Thunder