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

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




PostPosted: Wed Jan 05, 2005 7:43 pm   Post subject: Digits

Hi Guys!!!
I dont know how to show the significant digits in Turing. If i input 1000 the comp should show 1 digit but how???? PLease!!!
Lena.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Jan 05, 2005 9:32 pm   Post subject: (No subject)

convert the number to string (intstr()), cut off all the extra 0s off the end of it (str_variable(*) returns the last character; str_variable(1..*-1) returns everything but the last character).

when you're done cutting, just count the remaining length (length(str_variable))
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: