goodmorning,
I need to convert a string to a double. I thought of using atof wich i thought was described in stdlib.h, but i'm getting a error that the function is implicit. Is it possible to use atof ? Or should i use a different method ?

my second question is a little silly but wich .h should i include for the use of the root function ?
Duif, my apologies that it took me a while to get around to answering your post. Welcome to Cemetech, and be sure to Introduce Yourself when you get a chance. Is this your first Prizm program, or just your first Prizm C program? Although PrizmSDK offers software floats and doubles, the CPU in the device doesn't have built-in floating-point support (it lacks an FPU). My gut would be to use snscanf/sscanf and friends, but I don't think we have a working version of that yet. We don't have a built-in square root function, if the current SDK version matches my own, but it's not terribly hard to find a GPL or MIT-licensed implementation.
Indeed, none of those exist in current libfxcg. Mostly because I implement things as they seem most useful.

atof is easy enough to implement with repeated multiplications (or divisions as applicable) by 10 as you consume digits. sqrt() is somewhat harder, but IIRC typical implementations are iterative things along the lines of Newton's Method.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement