Solved

Use of the arithmetical coprocessor

Posted on 1998-10-30
13
218 Views
Last Modified: 2010-04-30
How can I access the mathemical instructions of the arithmecial coprocessor with VB or does an ActiveX exist ?
0
Comment
Question by:netf_ds
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1442547
You don't have to explicitly code for them. Since the FPU is built in the compiler knows to cut code for the FPU. You access them every time you code *, /, ^, and most trig functions.

M

0
 

Author Comment

by:netf_ds
ID: 1442548
I don't think the compiler does it by default, because my results are not accurate enough.
0
 

Author Comment

by:netf_ds
ID: 1442549
Sorry, I reopen the question.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mark2150
ID: 1442550
Change your data type if you're not getting enough accuracy. What type of accuracy are you looking for? CPU should be giving you at least 16 digits on transendentals.

M
0
 

Author Comment

by:netf_ds
ID: 1442551
I need the highest accuracy possible. And I already use a double.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1442552
What are you computing that you need more than what double's can give? How did you determine that there wasn't "enough" accuracy?

"Double (double-precision floating-point) variables are stored as IEEE 64-bit (8-byte) floating-point numbers ranging in value from -1.79769313486232E308 to -4.94065645841247E-324 for negative values and from 4.94065645841247E-324 to 1.79769313486232E308 for positive values. The type-declaration character for Double is the number sign (#)."

The Mathco functions aren't going to give you anything tighter than this.

M

0
 

Author Comment

by:netf_ds
ID: 1442553
The problem is not the double var, it's the precision of the computation (I have a function that does thousands of calculations with very small numbers). So I need to use the coprocessor.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1442554
Again, you *ARE* using the co-processor! It's *AUTOMATIC*. You CAN'T TURN IT OFF. Every time you execute a math instruction the MATHCO DOES IT!

M

0
 

Author Comment

by:netf_ds
ID: 1442555
The problem is not the double var, it's the precision of the computation (I have a function that does thousands of calculations with very small numbers). So I need to use the coprocessor.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1442556
The precision of the computation is limited by the precision of the *VARIABLES*. Again *YOU ARE ALREADY USING THE MATH COPROCESSOR*. IT IS PART OF THE CPU CHIP. There is no additional precision available!

M

0
 

Author Comment

by:netf_ds
ID: 1442557
so the question is a moving target.
Now, it is:

where can I find a good abritrary precision number package for VB.
Thank you
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1442558
Ahhh! Now *THAT* is a different question! To that, I don't know. What kind of data are you crunching? Sometimes if you change the order of operations you can keep things normalized.

You state that you're doing thousands of calculations with small numbers. Why not scale the numbers *up* prior to doing your operations and then divvy down as required. You're not going to get past 16 significant digits no matter what.

What kind of math are you doing? There are programs like MathCAD and such that are designed to do higher precision work.

M

0
 
LVL 1

Accepted Solution

by:
yfang earned 100 total points
ID: 1442559
I guess you have to use some mathematic techniques to solve your problem.  Some of these techniques are pretty easy, but they really work.  For example, if you lose significant digits because the values are too small, enlarge all the values for all the computation but the last step, at which you should compensate the results for the multiplier.  If you could describe you problem in detail, I would try to help.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 4 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question