How to simulate 8bytes double???

A

Auronc

Because my special compiler,I am looking for some class, which support
8 bytes double. I found my machine only supports 4 bytes for (double).
I need the operation: + - * / sin() cos() atan2()..etc.
Are there any kind soul to help me? Thanks a lot.
 
H

Howard

Auronc said:
Because my special compiler,I am looking for some class, which support
8 bytes double. I found my machine only supports 4 bytes for (double).
I need the operation: + - * / sin() cos() atan2()..etc.
Are there any kind soul to help me? Thanks a lot.

I don't know what kind of machine only supports 4-byte doubles, but you
might try asking others who use that machine. Perhaps there's a newsgroup
devoted to that machine? Or search at groups.google.com.

-Howard
 
J

JKop

Auronc posted:
Because my special compiler,I am looking for some class, which support
8 bytes double. I found my machine only supports 4 bytes for (double).
I need the operation: + - * / sin() cos() atan2()..etc.
Are there any kind soul to help me? Thanks a lot.

Yes I could help you, but not to be rude, that would result
in me writing the (long) class for you. I can suggest
methods though: instead of using decimals, define a minimal
unit, let's say 0.0000000000001 or whatever. You'll store
this as integer 1. Maybe try something along the following
lines:

class 8ByteDouble
{
private:
char bytes[4];

public:
8ByteDouble& operator+=(...
};

8ByteDouble sin(8ByteDouble& k)
{
....
}

Then again you could search the net and find one that's
already been done for you.

Have you tried "long double"?

Note that a "byte" is different sizes on different
machines. Most of them though are 8-Bit.


-JKop
 
A

Auronc

Dear :
I use the Product:"TI TMS320VC5510", related link:
http://focus.ti.com/docs/prod/folders/print/tms320vc5510.html

In this environment, its data type "double" is 4 bytes, and it doesn't
support 8bytes-double. The precision is not good enough for me. So I
need the class "8ByteDouble" to improve the precision.

For example,in this environment,
double dvar = 0.123456789999;
the compiler compiles the dvar : 0.1234568
caused by the length of the double is 4 bytes,not 8bytes.

But I need the 0.----9999.

The class 8ByteDouble could sovle this problem??
If no, any solution could sovle it??
Thanks for your help.
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top