Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 if statement
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
lurtz




PostPosted: Sat Feb 15, 2003 1:57 pm   Post subject: if statement

is it possible to say that if the product of a math function, like 3 div 2, is a real number to do something.

thanks
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Feb 15, 2003 2:18 pm   Post subject: (No subject)

you can use mod to see if there's a remainder. If remainder of a division is not 0, then the result would be a floating point number (decimals)

code:

if (3 mod 2) not=0 then
put "3 / 2 will produce a floating point result"
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: