Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Fortran and financial calculations
Is Fortran 95 suitable for financial calculations? I mean: I probably have
to perform all calculations with two digits after the decimal point and
then do some "Banker's rounding", but I have really no idea.

TIA,
GaK

Report this thread to moderator Post Follow-up to this message
Old Post
Gastfreund aus Korinth
07-29-04 02:06 AM


Re: Fortran and financial calculations
Gastfreund aus Korinth <keine@nirgendwo.de> wrote:
> Is Fortran 95 suitable for financial calculations? I mean: I probably have
> to perform all calculations with two digits after the decimal point and
> then do some "Banker's rounding", but I have really no idea.
>

One common trick is to perform all calculations in Cents (or Lepta or
whatever) and then shift the decimal point just for printing EURO (or
$ or EYPO or whatever) amounts. This at least avoids the problem that
a number like 0.01 EUR does not have an exact representation in binary
floating point. Double precision variables hold more digits than
integers and they may give you a handle for rounding.

Rounding may be more tricky. Whatever "Banker's rounding" means, you
will probably have to implement it by hand using AINT, ANINT or
whatever is suitable. The real problem is to avoid intermediate
rounding in more complex calculations (more complex than a single
operation).


--
Klaus Wacker              wacker@Physik.Uni-Dortmund.DE
Experimentelle Physik V   http://www.physik.uni-dortmund.de/~wacker
Universitaet Dortmund     Tel.: +49 231 755 3587
D-44221 Dortmund          Fax:  +49 231 755 4547

Report this thread to moderator Post Follow-up to this message
Old Post
Klaus Wacker
07-29-04 02:06 AM


Re: Fortran and financial calculations
"Gastfreund aus Korinth" <keine@nirgendwo.de> wrote in message
news:pan.2004.07.27.05.53.48.109000@nirgendwo.de...
> Is Fortran 95 suitable for financial calculations? I mean: I probably have
> to perform all calculations with two digits after the decimal point and
> then do some "Banker's rounding", but I have really no idea.
>
> TIA,
> GaK
>


Earlier this year I showed a Fortran solution
http://home.cfl.rr.com/davegemini/decimal.f90

to a multi-language challenge called "The IBM Telco Benchmark"
that has fastest processing of the 1 million phone call file.

Review:   http://www2.hursley.ibm.com/decimal/telco.html







Report this thread to moderator Post Follow-up to this message
Old Post
David Frank
07-29-04 02:06 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:30 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.