[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Accessing C floating point data type in MCL
- To: firstname.lastname@example.org (Ray Lam)
- Subject: Re: Accessing C floating point data type in MCL
- From: email@example.com (Bill St. Clair)
- Date: Mon, 30 Aug 1993 13:59:35 -0600
- Cc: info-mcl
At 4:26 PM 8/26/93 -0800, Ray Lam wrote:
> I'm looking for a function simular to "%get-long" but it will work on
>a ptr to a floating point number in C. I was looking into the
>file and found the function "%get-x2float". Can anyone tell me what that
Reads a 10-byte IEEE extended float from ptr and returns it as an
MCL 8-byte float.
(ccl::%float2x float ptr)
Stores the 8-byte MCL float as a 10-byte IEEE extended float at ptr.
(defun %safe-get-double (ptr)
; Reads an 8-byte IEEE double float from ptr and returns an 8-byte MCL float
(let ((float (ccl::%copy-float 1.0)))
(ccl::%get-double ptr float)
(ccl::%put-double flt ptr)
Stores the 8-byte MCL float as an 8-byte IEEE double float at ptr.
> Also, Can anyone tell me how a FLOAT datatype in C is represented in a
>32 and 64 bits? Where is the exponent and where is the mantissa. Thanks in
Don't know. Get the Apple Numerics book or find a specification of
IEEE floating point.