Hi,

If I do the following

sprintf("%A",pi)
"0X1.921FB54442D18"

I have this 16 byte character string

hx<-"400921FB54442D18"

This is the exact hex16 representation of PI in
IEEE float that R uses in Intel 32bit(little endian) Windows
SAS uses the same representation. 11 bit exponent and 53 bit mantissa.

I want to do is recreate the float exactly from the 16 char hex

something like

MyPI<-readChar(hx,numeric(),16)

or in SAS

MyPI=input("400921FB54442D18",hex16.);
put MyPI=;

MYPI=3.1415926536

What I am trying to do is set up a lossless
transfer method from SAS to R

-- 
View this message in context: 
http://n4.nabble.com/Converting-IEEE-Float-in-16-char-hex-back-to-float-tp1571710p1571710.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to