View previous topic :: View next topic |
Author |
Message |
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Aug 26, 2003 1:25 pm Post subject: Better VDS Math |
|
|
Hi All,
Just thought I would share this with everyone You know how everyone has asked for better math functions with VDS. Well as I come across math equations I will try to convert them to VDS and make VDS 5 functions out of them for everyone. So here is my first submission. Anybody is welcome to contribute to this if they like.
Code: | #DEFINE FUNCTION,FMOD
Info @fmod(400.5,300.2)
stop
:fmod
Rem This function works just like @Mod() but with floating point
rem numbers.
rem x = (%1 - (%2 * (%1 / %2)))
%%Ret = @fsub(%1,@fmul(%2,@div(@fint(%1),@fint(%2))))
Exit %%Ret
|
Anyway it's not much but there will be more to come. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Aug 26, 2003 3:46 pm Post subject: |
|
|
OR just this one built into VDS
Code: | @MOD(<value1>,<value2>)
Description:
Math function. Returns the value <value1> modulo <value2>.
OK:
Not changed.
|
I expect to see more examples mindpower.
Regards
EDIT:
I again proved bad at math as usual
I now noticed it is fmod and not just modulo _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Tue Aug 26, 2003 5:48 pm; edited 1 time in total |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Tue Aug 26, 2003 3:57 pm Post subject: |
|
|
I believe mindpower was talking about working with floating-point
numbers. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Aug 26, 2003 9:29 pm Post subject: |
|
|
That's ok CodeScript,
I am not a math Wiz either I am just a programmer....hehehehe _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
|