String to float conversion needed

Jonathan Shapiro jss at sjuvax.UUCP
Sat Nov 17 06:45:36 AEST 1984


[Aren't you hungry...?]

	This request should be easy.  None of the sites I have access to have
the IEEE floating point stuff. I am in need of a function/procedure, in C,
to convert a real number string to a real number.  The catch is, this is
not for the VAX, so scanf won't work.  The target formats I am looking for
are:

Single Precision:

       Sign bit (1)|Biased Exponent(8)|Mantissa Magnitude(23)

       Biased exponent = true exponent + 127

Double Precision:

       Sign bit (1)|Biased Exponent(11)|Mantissa Magnitude(52)

       Biased exponent = true exponent + 1023

	Ideally, these routines should not be dependent on any uniquely VAXish
tricks, though beggars can't be choosers.

Any help that you might provide would be greatly appreciated.

Thank you.

Jon Shapiro



More information about the Comp.lang.c mailing list