xref: /freebsd/share/man/man3/Q_QABS.3 (revision 397e83df75e0fcd0d3fcb95ae4d794cb7600fc89)
1.\"
2.\" Copyright (c) 2018 Netflix, Inc.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions, and the following disclaimer,
10.\"    without modification, immediately at the beginning of the file.
11.\" 2. The name of the author may not be used to endorse or promote products
12.\"    derived from this software without specific prior written permission.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
18.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.Dd July 8, 2018
27.Dt Q_QABS 3
28.Os
29.Sh NAME
30.Nm Q_QABS ,
31.Nm Q_Q2S ,
32.Nm Q_Q2F
33.Nd fixed-point math functions which operate on a single Q number
34.Sh SYNOPSIS
35.In sys/qmath.h
36.Ft QTYPE
37.Fn Q_QABS "QTYPE q"
38.Ft double
39.Fn Q_Q2D "QTYPE q"
40.Ft float
41.Fn Q_Q2F "QTYPE q"
42.Sh DESCRIPTION
43The
44.Fn Q_QABS
45function returns an absolute value representation of
46.Fa q .
47.Pp
48The
49.Fn Q_Q2D
50and
51.Fn Q_Q2F
52functions return the double and float representations of
53.Fa q
54respectively.
55.Pp
56All of those functions operate on
57the following data types:
58.Vt s8q_t ,
59.Vt u8q_t ,
60.Vt s16q_t ,
61.Vt u16q_t ,
62.Vt s32q_t ,
63.Vt u32q_t ,
64.Vt s64q_t ,
65and
66.Vt u64q_t ,
67which are referred to generically as
68.Fa QTYPE .
69.Pp
70For more details, see
71.Xr qmath 3 .
72.Sh RETURN VALUES
73.Fn Q_QABS
74function returns a QTYPE that is identical to that of
75.Fa q .
76.Pp
77The
78.Fn Q_Q2D
79and
80.Fn Q_Q2F
81functions return the double and float representations of
82.Fa q
83respectively.
84.Sh SEE ALSO
85.Xr errno 2 ,
86.Xr qmath 3 ,
87.Xr stdint 7
88.Sh HISTORY
89The
90.Xr qmath 3
91functions first appeared in
92.Fx 13.0 .
93.Sh AUTHORS
94.An -nosplit
95The
96.Xr qmath 3
97functions and this manual page were written by
98.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
99and sponsored by Netflix, Inc.
100