how to convert apfloat number to double type

H

hyena

Hi,

I am trying to use apfloat (http://www.apfloat.org)package to calculate a
production of a series probabilities. After the calculation, I need to
convert the result from apfloat type to normal double type, I could not find
a place to put this question, and thought maybe I could get some help in
this group:)

any tips?
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Hi,

I am trying to use apfloat (http://www.apfloat.org)package to calculate a
production of a series probabilities. After the calculation, I need to
convert the result from apfloat type to normal double type, I could not find
a place to put this question, and thought maybe I could get some help in
this group:)

A quick look at the documentation suggest that you could wite it to a
stringstream and read it back into a double, beware of the loss of
precision though. I didn't bother to read more than that so there might
be a better method supported by the package.
 
H

hyena

Thanks for your time. I just found a function called ap2double(..) which
seems to do waht I want, did not success in linking the program yet. Will
report if that is the function I am looking for or not.

BTW, I got another problem during linking, mingw complains the one function
"truncate" was a undefined reference from a call in file "datastru.cpp". I
understand this normally is caused by a missing function in library file.
Then I checked the library file and found "truncate.o" is the last object
file in this archive.

any idea why mingw linker complains? thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top