Debian Codegraph @

doc/src/intrinsics/numeric/aint.md

raw
1 # aint(x, [kind]): Truncate to a Whole Number
2
3 Truncate to a whole number.
4
5 ## Declaration
6
7 ### Syntax
8
9 ```fortran
10 retval = aint(x, [kind])
11 elemental real function aint(x, [kind])
12 ```
13
14 ### Arguments
15
16 `x` the input value must be of type real.
17
18 `kind` the optional input parameter initialises the kind of the result.
19
20 ### Return values
21
22 The return value is of type integer(kind) if kind is passed as input parameter.
23 If not, default kind real is returned.
24
25 The return value is equal to or nearest largest whole number greater than or
26 equal to `x` not exceeding its magnitude.
27
28 ## Description
29
30 **aint(x)** returns the nearest largest whole number greater than or equal to
31 `x` not exceeding input value's magnitude.
32
33 The optional parameter `kind` specifies the kind of the result.
34
35 ## Types
36
37 Supported argument types is real.
38
39 ## Examples
40
41 ```fortran
42 program intrinsics_aint
43 print *, aint(3.1)
44 print *, floor(-3.1)
45 end program
46 ```
47
48 **Result:**
49
50 ```
51 3
52 -3
53 ```
54
55 ## See Also
56
57 [ceiling](ceiling.md), [mod](mod.md).