I am working on converting parts of a C++ program to Python, but I have some trouble replacing the C function [strtod](http://www.cplusplus.com/reference/clibrary/cstdlib/strtod/).
The strings I'm working on consists of simple mathmatical-ish equations, such as "KM/1000.0". The problem is that the both constants and numbers are mixed and I'm therefore unable to use float().

How can a Python function be written to simulate `strtod` which returns both the converted number and the position of the next character?