<b>string_to_floating_point()</b>




Document: The safe-c User Guide

next floating_point_to_string()
up Functions
gif string_equal()

string_to_floating_point()

string_to_floating_point() accepts exactly one argument, which must be of string_type. This may be a variable or a constant. However, in practise, it is normally a variable (since, otherwise, a constant of floating_point_type could simply be used directly, instead of invoking string_to_floating_point() to process a string constant). In any case, if the argument is a variable, it will not be altered by string_to_floating_point().

string_to_floating_point() produces a return value of floating_point_type.

string_to_floating_point() examines the string given as an argument, and interprets it (if possible) as a decimal (base 10) number, possibly in scientific notation (e.g. "2.3e5" would denote etc.). Providing that the string can be interpreted successfully in this way, string_to_floating_point() will produce the internal binary representation (i.e. of floating_point_type) of this number as the return value. If the string cannot be interpreted in this way (e.g. "rhubarb" or "forty-two" or "(01) 704-5000" etc.) then a runtime exception will be generated and the program will terminate abnormally.




Document: The safe-c User Guide

next floating_point_to_string()
up Functions
gif string_equal()



McMullin@eeng.dcu.ie
Fri Jan 12 12:30:02 GMT 1996