GFORTH: alternative function to "fdepth"? = returning the current height of the float stack

23 Views Asked by At

I would like to know the depth of the float stack at a period of time when a word is called..

see https://gforth.org/manual/Examining-data.html#index-fdepth_0028--_002d_002d-_002bn--_0029-floating

the sequence is

..
F.S (result: <3> 5.000000000000E0 2.000000000000E0 2.000000000000E0 )
FDEPTH
F.S (result: <3> 5.000000000000E0 2.000000000000E0 2.000000000000E0 )
..

I dont see what FDEPTH is doing: I was expecting the value 3.0e would have been introduced at the float stack. But the stack did not change. I suppose this is an issue with FDEPTH gforth (maintener is contacted).

Has anybody a proposal how to define an alternative function to FDEPTH? (bringing into the stack the value which is the height of the stack).

Update: see answer below. The result of fdepth was in another stack. NOT the float stack.

0

There are 0 best solutions below