]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-libs-iso/LowShort.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-libs-iso / LowShort.def
CommitLineData
1eee94d3
GM
1(* LowShort.def provides access to limits of the gm2 SHORTREAL.
2
83ffe9cd 3Copyright (C) 2010-2023 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18Under Section 7 of GPL version 3, you are granted additional
19permissions described in the GCC Runtime Library Exception, version
203.1, as published by the Free Software Foundation.
21
22You should have received a copy of the GNU General Public License and
23a copy of the GCC Runtime Library Exception along with this program;
24see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25<http://www.gnu.org/licenses/>. *)
26
27DEFINITION MODULE LowShort;
28
29 (* Access to underlying properties of the type SHORTREAL *)
30
31CONST
32 radix = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, radix> )) ; (* ZType *)
33 places = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, places> )) ; (* ZType *)
34 expoMin = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, expoMin> )) ; (* ZType *)
35 expoMax = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, expoMax> )) ; (* ZType *)
36 large = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, large> )) ; (* RType *)
37 small = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, small> )) ; (* RType *)
38 IEC559 = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, IEC559> )) ; (* BOOLEAN *)
39 LIA1 = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, LIA1> )) ; (* BOOLEAN *)
40 ISO = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, ISO> )) ; (* BOOLEAN *)
41 IEEE = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, IEEE> )) ; (* BOOLEAN *)
42 rounds = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, rounds> )) ; (* BOOLEAN *)
43 gUnderflow = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, gUnderflow> )) ; (* BOOLEAN *)
44 exception = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, exception> )) ; (* BOOLEAN *)
45 extend = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, extend> )) ; (* BOOLEAN *)
46 nModes = __ATTRIBUTE__ __BUILTIN__ (( <SHORTREAL, nModes> )) ; (* ZType *)
47
48TYPE
49 Modes = PACKEDSET OF [0 .. nModes-1];
50
51PROCEDURE exponent (x: SHORTREAL): INTEGER;
52 (* Returns the exponent value of x *)
53
54PROCEDURE fraction (x: SHORTREAL): SHORTREAL;
55 (* Returns the significand (or significant part) of x *)
56
57PROCEDURE sign (x: SHORTREAL): SHORTREAL;
58 (* Returns the signum of x *)
59
60PROCEDURE succ (x: SHORTREAL): SHORTREAL;
61 (* Returns the next value of the type SHORTREAL greater than x *)
62
63PROCEDURE ulp (x: SHORTREAL): SHORTREAL;
64 (* Returns the value of a unit in the last place of x *)
65
66PROCEDURE pred (x: SHORTREAL): SHORTREAL;
67 (* Returns the previous value of the type SHORTREAL less than x *)
68
69PROCEDURE intpart (x: SHORTREAL): SHORTREAL;
70 (* Returns the integer part of x *)
71
72PROCEDURE fractpart (x: SHORTREAL): SHORTREAL;
73 (* Returns the fractional part of x *)
74
75PROCEDURE scale (x: SHORTREAL; n: INTEGER): SHORTREAL;
76 (* Returns the value of x * radix ** n *)
77
78PROCEDURE trunc (x: SHORTREAL; n: INTEGER): SHORTREAL;
79 (* Returns the value of the first n places of x *)
80
81PROCEDURE round (x: SHORTREAL; n: INTEGER): SHORTREAL;
82 (* Returns the value of x rounded to the first n places *)
83
84PROCEDURE synthesize (expart: INTEGER; frapart: SHORTREAL): SHORTREAL;
85 (* Returns a value of the type SHORTREAL constructed from the given expart and frapart *)
86
87PROCEDURE setMode (m: Modes);
88 (* Sets status flags appropriate to the underlying implementation of the type SHORTREAL *)
89
90PROCEDURE currentMode (): Modes;
91 (* Returns the current status flags in the form set by setMode *)
92
93PROCEDURE IsLowException (): BOOLEAN;
94 (* Returns TRUE if the current coroutine is in the exceptional execution state
95 because of the raising of an exception in a routine from this module; otherwise
96 returns FALSE.
97 *)
98
99END LowShort.