Thread: float()
View Single Post
  #12  
Old 08-17-2010, 08:18 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by MrOmega View Post
Call me stupid but what are some actual purpose of using float( "123str");
Let's assume we have user input. We want a number. The user gives us a string instead of a number. Ideally, throwing it into the float()-bin will return -1 and tell us it's a string this way. When there are numbers at the beginning, it won't. Don't see an issue though. Of course, this is just an example. Might be a problem elsewhere. But that can be worked around.
Reply With Quote