Re: [Flashforth-devel] Floating point math for FF 5.x
Brought to you by:
oh2aun
From: Mikael N. <mik...@fl...> - 2015-05-14 21:32:43
|
A first version that can parse and print floating point is available in git. Tested on dspic33fj128gp802. The CFloat.c file s not needed. FF calls the Microchip FP lib routines directly without any C layer. It is based on Leon Maurers FP work for Amforth. And on Igor Mokos adaptations. Just send the float.txt With ff-shell.py it looks like this: cd ff sudo shell/ff-shell.py -p /dev/ttyACM0 --xonxoff -s 38400 #send pic24/forth/float.txt ok<#,ram> f# 3.14e-9 f. 0.00000000314000 ok<#,ram> f# 3.14e-9 fs. 3.14000E-9 ok<#,ram> f# 3.14e-8 fs. 3.14000E-8 ok<#,ram> Excerpt from WORDS below: facos fasin fatan flog10 flog fexp fsqrt ftan fcos fsin fpow f/ f* f- f+ f# string>float extract fs. fe. f. f.no-space round2prc precision emitnzeros fprintdigits femitdigit emitdigit tkcofsign smlrpow10 f10^n fround fmod1 ceil floor f~ fprep4div fmin fmax f<= f>= f> f< f2* f2/ f= fabs negateiftrue fnegateifneg fnegate f0< f0= f>s f>d s>f d>f faddtoexponent f>sigexp sigexp>f fshifttoexp flshiftn flshift frshiftn frshift fmksgnd fsetsign fsetexponent fsignificand fsign fexponent frawexponent dsplit dnegateifneg d10* >= f0.5 f10 f1 f0 fliteral fvariable fconstant f! f@ fnover nfover fnswap nfswap ftuck fnip frot fswap fover fdup fdrop d>s 0> -fpmath |