> From:	SMTP%"lionel@quark.enet.dec.com"  1-JUN-1993 13:09:04.28 To:	EVERHART CC:	) Subj:	Re: Converting D_FLOATS to G_FLOATS    X-Newsgroups: comp.os.vms . From: lionel@quark.enet.dec.com (Steve Lionel), Subject: Re: Converting D_FLOATS to G_FLOATS6 Message-ID: <1993Jun1.152152.16808@dbased.nuo.dec.com>	 Lines: 56 4 Sender: news@dbased.nuo.dec.com (USENET News System)2 Reply-To: lionel@quark.enet.dec.com (Steve Lionel)6 Organization: Digital Equipment Corporation, Nashua NH" Date: Tue, 1 Jun 1993 15:21:52 GMT To: Info-VAX@KL.SRI.COM  X-Gateway-Source-Info: USENET     : In article <1993May31.150932.1@slacvx.slac.stanford.edu>, * fairfield@slacvx.slac.stanford.edu writes:M |>In article <1udmf8$3qm@sun.Panix.Com>, sabu@panix.com (Sabu Bhatia) writes: R |>> Has anyone ou there written a function in vaxc to convert D_FLOATS to G_FLOATSN |>> using descriptors and LIB$* system calls. If so I would be greatful if you |>> could mail me a copy |>J |>    A careful reading of the OLD (or the FM) reveals that LIB$CVT_DX_DX O |>_won't_ work for your purposes: it basically converts numeric bytes to text,   |>or text to binary.  E This is not true, but I can certainly understand how you reached that J conclusion based on what's in the manual.  Indeed, the manual is SERIOUSLYF confused, and I will bring this up to the writers.  LIB$CVT_DX_DX willF convert between any two atomic datatypes for which you can construct aJ valid descriptor.  It can also convert atomic types to (or from) text, andG it is this latter capability which most of the confusing manual text is  attempting to describe.    |>K |>    What _will_ work are a pair of routines in the MTH$ run-time library:  |>P |>     d_float = MTH$CVT_G_D (&g_float);  /* Convert G-floating to D-floating */P |>     g_float = MTH$CVT_D_G (&d_float);  /* Convert D-floating to G-floating */  H Yes, these will also work and are the routines I would recommend for theM purpose.  Note that there are also variants (MTH$CVT_GA_DA and MTH$CVT_DA_GA) + which convert arrays of values in one call.    |>I |>I did a quick search of the .H files in SYS$LIBRARY and failed to find  J |>function prototypes for these entries, so perhaps you'll have to do thatI |>yourself...  Not being really up to speed on VAXC, perhaps someone else M |>can enlighten us on where the MTH$ run-time library prototypes hide, or ???  |>  G Good question.  I'd expect them to be in a MTH$ROUTINES.H, as there are E similar files for other RTL facilities (LIB$, etc.), but this doesn't G exist.  Perhaps the VAX C folks thought that MATH.H, which defines most H math intrinsics, would do instead?  I'll pass along to them a suggestion( that they also provide a MTH$ROUTINES.H.  G These routines are documented in the online HELP under HELP RTL.  But I H admit that the MTH$ facility is probably not the place most people wouldF go to look for them.  Our thinking at the time was that these routinesJ "looked like" MTH$ routines, in that they returned a function value ratherG than a status as most (but not all) of the LIB$ routines do, and signal & errors rather than returning a status. --  9 Steve Lionel                    lionel@quark.enet.dec.com  SDT Languages Group  Digital Equipment Corporation  110 Spit Brook Road  Nashua, NH 03062  