FLIT
=> "FORTH"
(no description)
primitive code = [p4_f_literal_execution]
FP@
( -- addr )
=> "FORTH"
returns the floating point stack pointer
primitive code = [p4_f_p_fetch]
FP!
( addr -- )
=> "FORTH"
sets the floating point stack pointer -
this is the inverse of FP@
primitive code = [p4_f_p_store]
F=
=> "FORTH"
(no description)
primitive code = [p4_f_equal]
F<>
( f: a b -- s: a!=b )
=> "FORTH"
-
primitive code = [p4_f_not_equal]
F>
=> "FORTH"
(no description)
primitive code = [p4_f_greater_than]
F<=
=> "FORTH"
(no description)
primitive code = [p4_f_less_than_or_equal]
F>=
=> "FORTH"
(no description)
primitive code = [p4_f_greater_than_or_equal]
S>F
( n -- f: x )
=> "FORTH"
it's inverse is F>S
- convert a cell parameter to floating-point.
primitive code = [p4_s_to_f]
FTRUNC>S
(f: x -- s: n )
=> "FORTH"
The word F>S
was sometimes defined with a different behavior
than FTRUNC>S
which is the type-cast behaviour of C according
to C99 section 6.3.1.4 - truncation would also match the ANS-Forth
specification for F>D
.
Some systems used F>S
defined to FROUND>S
instead. The pfe
provides explicit words for both conversions, the word FROUND>S
and FTRUNC>S
which return single-cell parameters for a floating
point number with the conversion method of FTRUNC
or FROUND
.
In PFE, F>S
is a synonym pointing to FTRUNC>S
in analogy
of the behavior of F>D
where no explicit word exists. The
inverse of F>S
is the cast conversion of S>F
.
primitive code = [p4_f_trunc_to_s]
FROUND>S
(f: x -- s: n)
=> "FORTH"
complements FTRUNC>S
for applications that expect F>S
to
be defined with a rounding behavior like
: FROUND>S FROUND FTRUNC>S ;
primitive code = [p4_f_round_to_s]
FTRUNC
(f: x -- x' )
=> "FORTH"
truncate towards zero, discard a fractional part. See also FTRUNC>S
conversion and the FROUND
and FLOOR
adaptors.
: FTRUNC FDUP F0< IF FCEIL ELSE FLOOR THEN ;
(When available, uses a single call to C99 trunc() internally)
primitive code = [p4_f_trunc]
-FROT
(f: x1 x2 x3 -- x3 x1 x2 )
=> "FORTH"
F-stack equivalent of -ROT
note, some systems call this work F-ROT,
here it is the inverse of FROT
primitive code = [p4_minus_f_rot]
FNIP
(f: x1 x2 -- x2 )
=> "FORTH"
F-stack equivalent of NIP
primitive code = [p4_f_nip]
FTUCK
(f: x1 x2 -- x2 x1 x2 )
=> "FORTH"
F-stack equivalent of TUCK
primitive code = [p4_f_tuck]
1/F
(f: x -- 1/x )
=> "FORTH"
-
primitive code = [p4_one_over_f]
F^2
(f: x -- x^2 )
=> "FORTH"
-
primitive code = [p4_f_square]
F^N
( u f: x -- x^u )
=> "FORTH"
For large exponents, use F** instead. Of course u=-1 is large.
primitive code = [p4_f_power_n]
F2/
(f: x -- x/2 )
=> "FORTH"
-
primitive code = [p4_f_two_slash]
F2*
(f: x -- x*2 )
=> "FORTH"
-
primitive code = [p4_f_two_star]
F0>
(f: x -- s: flag )
=> "FORTH"
-
primitive code = [p4_f_zero_greater]
F0<>
(f: x -- s: flag )
=> "FORTH"
-
primitive code = [p4_f_zero_not_equal]