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

Username:   Password: 
 RegisterRegister   
 Is there a function in turing that does the opposite of strrealok ?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SamF




PostPosted: Tue Jan 05, 2010 9:00 pm   Post subject: Is there a function in turing that does the opposite of strrealok ?

Is there a function in turing that does the opposite of strrealok ?
Is there a function that checks if a real number can be converted into string without causing an error?
Sponsor
Sponsor
Sponsor
sponsor
TheGuardian001




PostPosted: Tue Jan 05, 2010 9:20 pm   Post subject: Re: Is there a function in turing that does the opposite of strrealok ?

Any real number can be stored in a string, as strings can hold any character. If it's a valid real number, it can safely be converted to a string.
btiffin




PostPosted: Tue Jan 05, 2010 10:51 pm   Post subject: Re: Is there a function in turing that does the opposite of strrealok ?

Well, (I'm just being a stickly turd here ... nothing serious)

Plop this 32-bit value in a field and display it as a single precision float.

0 11111111 10000100000000000000000

Spaces for effect, ignore them, seriously. If you are not doing rocket science or financials, this stuff can safely be ignored.

For those that may care, with the spaces; think sign, exponent, fraction, infinity and IEEE-754 quiet and signalling NaN.

I'm going to assume Turing will never allow NaN in a floating point value though, nor would it throw an error on a signalling NaN bit pattern, so again, there are rarely worries and I'm being a weenie even mentioning this. Wink

Cheers
mirhagk




PostPosted: Wed Jan 06, 2010 7:11 am   Post subject: RE:Is there a function in turing that does the opposite of strrealok ?

real can always be converted to string, as long as it has something at all in it (even if that something is 0). So just make sure you initialize it before your call to convert it.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: