03-07-2005, 07:22 AM
Thanks, Dr., I'll try it.
*****
*****
Having trouble understanding how to download FreeBasic.
|
03-07-2005, 07:22 AM
Thanks, Dr., I'll try it.
*****
03-07-2005, 07:26 AM
Quote:* Can I compile and get an executable using the IDE? Or will I have to run in emulation mode, which I don't want?Yes, the IDE will pass the bas file to fbc.exe for you, report any errors, and even run the program for you. No emulation required: The IDE, fbc.exe, and the exes generated by fbc.exe will all be regular 32 bit Windows programs. Yes, you can avoid MSDOS altogether, and you won't have to use any command prompt.
03-07-2005, 08:16 AM
STERLING, Thanks for the good info.
DR., I downloaded the IDE stuff you provided, ran the setup, and tested the little program (written by Neo) at the bottom of this post. It runs, but doesn't always give the right answers. Examples: Value of 9, base of 3, answer is 2 (correct) Value of 27, base of 3, answer is 3 (correct) Value of 125, base of 5, answer is -1 (error, should be 3, which it gives when run under DOS). Is there any good reason for this? Is the program using something that is not supported by FB? ***** Code: rem Neo's Power-of solution
03-07-2005, 10:04 AM
changed exponent# to exponent! and took out the cdbl's and it worked perfectly. doubles are evil for seeing if they're whole numbers, and they're more precision than you need anyway if all you're doing anyway since you only use the value if it's a whole number.
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side...phear
03-07-2005, 10:08 AM
or, here's a way to keep the double precisions.
Code: FUNCTION GetExponent(Value AS INTEGER, BaseValue AS INTEGER)
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side...phear
03-07-2005, 09:59 PM
Floating-point numbers should never be compared for equality, at least use an epsilon: http://teaching.idallen.com/cst8110/97s/...point.html .
FB will leave the floating-point operands in the FPU stack (80-bit precision) when possible, while in QB all functions returning floats had to store the results on vars (the hidden argument), where you have max 64 bits with DOUBLE's.
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
03-09-2005, 08:21 AM
Thanks, Dumbledore.
So what's the tip regarding using "double" in FB? Are you saying that it should not be used? *****
03-09-2005, 08:30 AM
Where did you get that idea?
I said, comparing floating-point numbers for EQUALITY is not recommended in ANY language.
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
03-13-2005, 06:27 AM
V3czOr,
Ok, ok, I get your point. After thinking about it, you're right, comparing floating point numbers for equality is risky and should be avoided. I originally thought that it was a FB incompatibility. In the case of this little program, the floating point problem did not manifest itself in Qbasic, but in FB it did. Thanks. *****
04-08-2005, 07:13 AM
Well, here I am 4 weeks later. With the great help from you guys, and your patience with me, I finally accomplished what I intended to do using FB, which is:
* Write a program in QB. * Compile it at home with FB, and test it. * Take it into work and install on a PC which does not allow MSDOS nor any 16 bit programs. * EUREKA!!! The son-of-a-gun runs like a charm. :bounce: The people at work thought I was crazy when I told them what I was gonna do. Now they're believers when they saw it run. FB could start a revolution. All us old QB or QuickBasic programmers that were laughed at for using Basic and MSDOS, can now have the last laugh. Thanks again to you guys. ***** |
« Next Oldest | Next Newest »
|