forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Better VDS Math

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Aug 26, 2003 1:25 pm    Post subject: Better VDS Math Reply with quote

Hi All,
Just thought I would share this with everyone Smile 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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1054
Location: India

PostPosted: Tue Aug 26, 2003 3:46 pm    Post subject: Reply with quote

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 Laughing
I now noticed it is fmod and not just modulo

_________________
Regards
- CodeScript
Arrow 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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Tue Aug 26, 2003 3:57 pm    Post subject: Reply with quote

I believe mindpower was talking about working with floating-point
numbers.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Aug 26, 2003 9:29 pm    Post subject: Reply with quote

That's ok CodeScript,
I am not a math Wiz either Wink I am just a programmer....hehehehe

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group