nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

Zinsen

Von: Marcel Hendrix (mhx@iae.nl) [Profil]
Datum: 28.10.2009 19:40
Message-ID: <08833527133558@frunobulax.edu>
Newsgroup: de.comp.lang.forth
Geht wahrscheinlich nicht mit der iForth Evaluation version.

-marcel

-- ------------------------------------------------------------------
(*
* LANGUAGE    : ANS Forth with extensions
* PROJECT     : Forth Environments
* DESCRIPTION : Question in Vierte Dimension
* CATEGORY    : fooling around
* AUTHOR      : Marcel Hendrix
* LAST CHANGE : Wednesday, October 28, 2009, 20:06, Marcel Hendrix
*)



NEEDS -miscutil

S" IFORTH" SEARCH-ENV$ DROP
S" /examples/bignum/factor.frt" $+ INCLUDED

REVISION -zinsen "ÄÄÄ Zinsen problem      Version 1.00
ÄÄÄ"

PRIVATES

DOC
(*
Johannes Brooks in VD 3/2009:

Creating --- Zinsen problem      Version 1.00 ---

ZINSEN  -- What does 1 Pfennig with 5% interest bring
in 2003 years?
ok
FORTH> zinsen ( 1*[105/100]^2003 )
1 Pfenning with 5% interest grows to
2767999689615763453442122197746377688543583.8 Pfennigen
in 2003 years.
0.004 seconds elapsed. ok
*)
ENDDOC

GIANT teller PRIVATE
GIANT noemer PRIVATE

: COMPUTE ( -- c-addr u )
#105 #2003 teller Gm^n  teller #10 GS*
#100 #2003 noemer Gm^n
teller noemer GG/ teller GIANT> ; PRIVATE

: ZINSEN ( -- )
TIMER-RESET
CR ." 1 Pfenning with 5% interest grows to "
COMPUTE 2DUP 1- TYPE  '.' EMIT  DUP 1- /STRING TYPE
."  Pfennigen in 2003 years. "
CR .ELAPSED ;

:ABOUT	CR ." ZINSEN  -- 1 Pfennig with 5% interest in 2003 years?" ;

.ABOUT -zinsen CR
DEPRIVE

(* End of Source *)


[ Auf dieses Posting antworten ]