a68_op (A68_EXT, "CLEAR", m, a68_lower_clear3);
m = a68_proc (M_BOOL, M_LONG_LONG_BITS, M_INT, NO_MOID);
a68_op (A68_EXT, "TEST", m, a68_lower_test3);
+ /* REAL operators. */
+ m = a68_proc (M_INT, M_REAL, NO_MOID);
+ a68_op (A68_EXT, "FLOOR", m, a68_lower_entier2);
+ /* LONG REAL operators. */
+ m = a68_proc (M_LONG_INT, M_LONG_REAL, NO_MOID);
+ a68_op (A68_EXT, "FLOOR", m, a68_lower_entier2);
+ /* LONG REAL operators. */
+ m = a68_proc (M_LONG_LONG_INT, M_LONG_LONG_REAL, NO_MOID);
+ a68_op (A68_EXT, "FLOOR", m, a68_lower_entier2);
}
/* POSIX prelude. */
Monadic operator that yields the nearest integer to its operand.
@end deftypefn
-@deftypefn Operator {} {@B{entier}} {= (@B{l} @B{real} a) @B{int}}
+@deftypefn Operator {} {@B{entier}} {= (@B{l} @B{real} a) @B{l} @B{int}}
Monadic operator that yields the integer equal to @code{a}, or the
next integer below (more negative than) @code{a}.
+
+Selecting the @option{gnu68} dialect provides the @B{floor}
+operator as a synonym for @B{entier}. @xref{Extended real operators}.
@end deftypefn
@deftypefn Operator {} {@B{shorten}} {= (@B{long} @B{real} a) @B{real}}
* Extended rows operators:: Rows and associated operations.
* Extended boolean operators:: Operations on boolean operands.
* Extended bits operators:: Bits and associated operations.
+* Extended real operators:: Operations on real operands.
* Extended math procedures:: Mathematical constants and functions.
@end menu
@B{false}.
@end deftypefn
+@node Extended real operators
+@section Extended real operators
+
+@deftypefn Operator {} {@B{floor}} {= (@B{l} @B{real} a) @B{l} @B{int}}
+Monadic operator that yields the integer equal to @code{a} rounded
+towards negative infinity.
+
+An alias for operator @B{entier}. @xref{Real operators}.
+@end deftypefn
+
@node Extended math procedures
@section Extended math procedures
--- /dev/null
+# { dg-options "-fstropping=upper -std=algol68" } #
+BEGIN # FLOOR is a GNU extension #
+ FLOOR 1.2 # { dg-error "indicant FLOOR has not been declared properly" } #
+END
LONG LONG REAL xxx = LONG LONG 3.14, yyy = LONG LONG 3.80;
ASSERT (ENTIER x = 3 AND ENTIER y = 3);
ASSERT (ENTIER xx = LONG 3 AND ENTIER yy = LONG 3);
- ASSERT (ENTIER xxx = LONG LONG 3 AND ENTIER yyy = LONG LONG 3)
+ ASSERT (ENTIER xxx = LONG LONG 3 AND ENTIER yyy = LONG LONG 3);
+ ASSERT (ENTIER x = 3 AND FLOOR y = 3);
+ ASSERT (ENTIER xx = LONG 3 AND FLOOR yy = LONG 3);
+ ASSERT (ENTIER xxx = LONG LONG 3 AND FLOOR yyy = LONG LONG 3)
END