473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to convert apfloat number to double type

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?
Apr 24 '07 #1
3 2030
On 2007-04-24 18:45, hyena wrote:
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.

--
Erik Wikström
Apr 24 '07 #2
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.
"Erik Wikström" <Er***********@telia.comwrote in message
news:7c*******************@newsb.telia.net...
On 2007-04-24 18:45, hyena wrote:
>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.

--
Erik Wikström

Apr 24 '07 #3
hyena wrote:
Thanks for your time.


Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or the group FAQ list:
<http://www.parashift.com/c++-faq-lite/how-to-post.html>
Apr 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: cindy liu | last post by:
Hi, In .Net, how to convert a string to a double? Thanks in advance! Cindy
17
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge...
28
by: MLH | last post by:
The largest integer A97 can deal with is 2,147,483,647, as I understand it from HELP. I would be content to represent larger integers as strings. For example, "2147483648" would suit me fine. I...
5
by: Steven | last post by:
I have tried to use FormatNumber() to convert a very large double type number to String format, however, the result seems not correct, is there any limitation for using FormatNumber() function? ...
3
by: rishabhshrivastava | last post by:
Hello All, How can I convert a value to Double in JavaScript??? In vbscript i believe its done as cDbl(Value) I tried lots of way but getting a value of "NaN". Any suggestions/ideas will...
6
by: compboy | last post by:
Can anyone help me about this. I have been trying all the ways I knew and I could find but just didnt work. I have tried: using itoa but it says that it doesnt have that function. and...
5
by: yekasi | last post by:
Hi, I have this number, 1.5283632704970307 in char*, and I need to convert it to a double type in C++ that is capable of storing that number of precisions.... I tried doing atof and storing it...
28
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
3
by: mrajanikrishna | last post by:
Hi Friends, I am accepting a number from the user entered in a textbox. I want to assign to a variable in my code and assignt this to that variable. double num1 = (double)txtNum1.text; ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.