Search code examples
c++notation

Flex real type definition in scientific and engineering notation in c++


I'm defining a real type and I'm using strtod for the exponential way even though is untested and don't really know if it works but more imporantly I would like to know if there is any built in function like strtod for engineering notation and if there isn't, how can I do it?

Thanks in advance, Martin


Solution

  • strtod understands exponential notation. See, e.g., http://pubs.opengroup.org/onlinepubs/009695399/functions/strtod.html .