Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to simulate 8bytes double???

Reply
Thread Tools

How to simulate 8bytes double???

 
 
Auronc
Guest
Posts: n/a
 
      09-08-2004
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.
 
Reply With Quote
 
 
 
 
Howard
Guest
Posts: n/a
 
      09-08-2004

"Auronc" <> wrote in message
news: om...
> 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


 
Reply With Quote
 
 
 
 
JKop
Guest
Posts: n/a
 
      09-08-2004
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
 
Reply With Quote
 
Auronc
Guest
Posts: n/a
 
      09-09-2004
Dear :
I use the Product:"TI TMS320VC5510", related link:
http://focus.ti.com/docs/prod/folder...320vc5510.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.




JKop <> wrote in message news:<GHG%c.26841$>...
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
ValueError: Procedure probably called with not enough arguments (8bytes missing) LabJack Support Python 0 08-07-2009 10:16 PM
Want to simulate logic gates usao VHDL 1 04-14-2004 07:36 AM
simulate virtual directory - I need it urgently Amir Eshterayeh ASP .Net 1 02-05-2004 01:11 PM
I cannot simulate Max VHDL 1 09-14-2003 07:57 PM



Advertisments