I'm working on some projects that require a good deal of floating point math.
I am trying to move over from PIC ASM because I figured a higher level language would rid me of having to deal with the nitty gritty of this kind of thing.
I haven't seen any complex math modules out there. The website indicated that a math module was in the works, but I was wondering if there were any user created modules out there that that can do things like trig (including inverse trig functions), square root, log base 10, natural log, etc.
Thanks!
New here - math questions
Moderators: David Barker, Jerry Messina
-
- Registered User
- Posts: 185
- Joined: Mon Mar 10, 2008 8:20 am
- Location: Seattle, WA USA
- Contact:
These are the floating point functions in the math module.
Code: Select all
Subroutines and Functions
function abs (pValue as type) as byte
function trunk (pValue as float) as float
function round (pValue as float) as float
function ceil (pValue as float) as float
function floor (pValue as float) as float
function fmod (x,y as float) as float
function modf (pValue as float, byref pIntegral as float) as float
function sqrt (pValue as float) as float
function cos (pValue as float) as float
function sin (pValue as float) as float
function tan (pValue as float) as float
function acos (pValue as float) as float
function asin (pValue as float) as float
function atan (pValue as float) as float
function exp (pValue as float) as float
function log (pValue as float) as float
function log10 (pValue as float) as float
function Pow ([pBase as type,] pExp as byte) as longword
function atan2 (y,x as float) as float
function cosh (x as float) as float
function sinh (x as float) as float
function tanh (x as float) as float
function frexp (x as float, byref exp as shortint) as float
function ldexp (value as float, exp as shortint) as float
-
- Posts: 10
- Joined: Tue Feb 08, 2011 10:51 pm
Thanks for that reply!
How do I get to that? I know I can just include it, but I want to actually open it up and look at it.
I have SF SE downloaded on my computer. I can see samples, but I have no idea where the directory is with all the include files. I'd like to take a look. Can you point me to how to do it?
How do I get to that? I know I can just include it, but I want to actually open it up and look at it.
I have SF SE downloaded on my computer. I can see samples, but I have no idea where the directory is with all the include files. I'd like to take a look. Can you point me to how to do it?
-
- Registered User
- Posts: 185
- Joined: Mon Mar 10, 2008 8:20 am
- Location: Seattle, WA USA
- Contact:
If you include the math module:
the math module will show up on the left hand side of the screen of the IDE with all the other program parameters. Clicking on it there will open a screen with the module listing.
The commands I listed come from the on-line help file. Click help on the IDE menu bar to find this. It's the best documentation for Swordfish. Enter "math" in the search box, and select "Swordfish Library" from the search results.
Jon
Code: Select all
Include ("math.bas")
The commands I listed come from the on-line help file. Click help on the IDE menu bar to find this. It's the best documentation for Swordfish. Enter "math" in the search box, and select "Swordfish Library" from the search results.
Jon