Chapter 3, Excercise 12
parsko
Posts: 501
When I compile it gives me an error message "expected an expression term" and it highlights the TRUNC command.
Any thoughts?
-Parsko
BTW- Video, USB2SER, Propstick, everyone is running happily!!! I love F10 so much!
Any thoughts?
-Parsko
BTW- Video, USB2SER, Propstick, everyone is running happily!!! I love F10 so much!
{{ RealNumbers.spin}} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 iB = 760 'Integer constants iC = 3875 iD = 1250 B = 7.6 'Floating-point constants C = 38.75 D = 12.5 K = 100.0 'Real-to-Pseudo-Real multiplier OBJ Term : "TV_Terminal" F : "FloatMath" FS : "FloatString" PUB Math Term.Start(12) {Integer constants (real numbers * 100) to do fast integer math} Term.Str(string("Pseudo-Real Number Result: ")) Term.Dec(iB*iC/iD) {Floating-point constants using FloatMath and FloatString objects} Term.Out(13) Term.Str(string("Floating-Point Number Result: ")) Term.Str(FS.FloatToString(F.FDiv(F.FMul(B, C), D))) {Floating-point constants translated to pseudo-real for fast math} Term.Out(13) Term.Str(string("Another Pseudo-Real Number Result: ")) Term.Dec(TRUNC(B*K)*trunc(C*K)/trunc(D*K))
Comments
sSid
·term.dec(CONSTANT(TRUNC...............
Sid
-Parsko