Advertisement

Huge Floating point calculation

Started by April 23, 2002 05:46 AM
5 comments, last by amreshr 22 years, 9 months ago
Hi, I would like to develop smt like the Window Scientific calculator and noticed that it supports very huge floating point calculations. The numbers are larger than the __int64 or long double data types. It takes any number greater than any data type. How is this done? If you have any links please provide. I have tried searching the web, but no luck. TIA dArkteMplaR of Delphi
dArkteMplaR of Delphi
This question belongs to programming forums, not to maths and physics. I am not aware of any built-in way of solving your problem, but you can always write a BIGNUMBER class that implements large numbers with two (or more) long doubles, and overloads all the common operators. I don't know about you, but I think it could be pretty fun to define all the operations

Cédric

[edited by - cedricl on April 23, 2002 9:09:02 AM]
Advertisement
the windows calculator is accurate to 32 digits. most likly they are using some form of fixed point BCD (Binary Coded Decimal) math or more likly just long doubles. also the calculator tries to keep things in fraction form if possible to increase accuracy. check the help which will explain (not too much better) the accuracy the calculator has. developing a large number system is not too difficult for most basic operations. things like log, sin, atan, etc will be tougher. do soem research on the net and you will find many examples and explainations of what you need to do.
It is written in the MSDN that VC''s double and long double are both 64 bits, although format are different but the precision are the same.

It also mentioned that ANSI C/C++ allows that.

I heard Borland C++ long double is 80 bits.VC does not support that.

Fyi, from what I read from a assembly book, the intel''s FPU''s IEEE internal format is 80 bits. Before any computation, 64bit double converts to 80 bits, after computations, converts back to 64bits.

I think Windows Calculator uses 80 bit long double. I think you got to use inline assembly to program the 80bit long double calculation if you are using VC6. I''m not sure about VC7.
it uses 64bit floatingpoins, namely known as doubles. you can test it, its exactly that..
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

As moderator of the forum, I don''t have a problem with this thread being in this forum. I consider floating point representation issues to be related to math---certainly numerical methods and worlds with multiple length scales (dealing with the very large and the very small), and I can envision cases where this could be important in games. .

amreshr, I will reminder you that these forums are for game development issues. A scientific calculator application isn''t really a game, and you should keep questions about how to code one to a minimum. There are many other places to learn about Windows programming for general applications.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Advertisement
Hi,
Thanks for the replies everyone.
grhodes_at_work: Actually, I am not working on a scientific calculator, but on the Method of Nodal Condensation (extension of FEM, but doesn''t work with very huge matrices, but 6x6 matrices). I really appreciate the fact that you are allowing this post in the forum. Oh! I don''t think that the application I am developing is ''general'' in anyway. It is for a select few fellow ''rocket'' scientists. Anyway, I don''t want to have an elitist attitude or anything of that sort and consider that one form of development is in anyway superior to the other. Everyone wants to live and make money, it doesn''t make a difference which part of the development cycle or what type of application the person develops. I do agree that game development is working on the edge and it is almost always on the cutting edge, and if there was any place that I knew of, where I could ask this, I wouldn''t have asked it here.

Oh! BTW, I don''t need answers on coding, if I arrive at an idea, I can code it myself. All I asked was for an idea to compare it with the one that I have, so that I could choose the best.

Thanks for the patience and understanding.

fellow researcher
dArkteMplaR of Delphi

This topic is closed to new replies.

Advertisement