I'm trying to use floating point on arm cortex, however I believe that the following code does not populate the dictionary with exponents:
The host has:
: farray \ n -- ; i -- addr
\ *G Use in the form: *\fo{n FARRAY <name>} to create a variable
\ ** that will hold a default floating point number. When the
\ ** array name is executed, the index i is used to retun the
\ ** address of the i'th 0 zero-based element in the array.
\ ** For example, *\fo{5 FARRAY TEST} will set up 5 array elements
\ ** each containing 0, and then *\fo{f n TEST F!} will store f in
\ ** the nth element, and *\fo{n TEST F@} will fetch it.
create
0 max floats allot&erase
does>
swap FPCELL * + \ make address
;
The target has:
: farray \ n -- ; i -- addr
\ *G Use in the form: *\fo{n FARRAY <name>} to create a variable
\ ** that will hold a default floating point number. When the
\ ** array name is executed, the index i is used to retun the
\ ** address of the i'th 0 zero-based element in the array.
\ ** For example, *\fo{5 FARRAY TEST} will set up 5 array elements
\ ** each containing 0, and then *\fo{f n TEST F!} will store f in
\ ** the nth element, and *\fo{n TEST F@} will fetch it.
create
\ 0 max floats allot&erase
0 ?do , loop
does>
swap FPCELL * + \ make address
;
So when the compiler executes the following:
F# 1.0E15 F# 1.0E14 F# 1.0E13 F# 1.0E12 F# 1.0E11
F# 1.0E10 F# 1.0E09 F# 1.0E08 F# 1.0E07 F# 1.0E06
F# 1.0E05 F# 1.0E04 F# 1.0E03 F# 1.0E02 F# 1.0E01
F# 1.0e00
16 FARRAY POWERS-OF-10E1
\ *G An array of 16 powers of ten starting at 10^0
\ ** in steps of 1.
the array is empty.
I'm still trying to get my head around how cross compiling works, so if I have this wrong, I would appreciate a nudge in the right direction.
As it stands at the moment floating-point does not work because the exp is never present.
thanks,
Theo