xref: /freebsd/share/man/man3/Q_QABS.3 (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
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.\" $FreeBSD$
27.\"
28.Dd July 8, 2018
29.Dt Q_QABS 3
30.Os
31.Sh NAME
32.Nm Q_QABS ,
33.Nm Q_Q2S ,
34.Nm Q_Q2F
35.Nd fixed-point math functions which operate on a single Q number
36.Sh SYNOPSIS
37.In sys/qmath.h
38.Ft QTYPE
39.Fn Q_QABS "QTYPE q"
40.Ft double
41.Fn Q_Q2D "QTYPE q"
42.Ft float
43.Fn Q_Q2F "QTYPE q"
44.Sh DESCRIPTION
45The
46.Fn Q_QABS
47function returns an absolute value representation of
48.Fa q .
49.Pp
50The
51.Fn Q_Q2D
52and
53.Fn Q_Q2F
54functions return the double and float representations of
55.Fa q
56respectively.
57.Pp
58All of those functions operate on
59the following data types:
60.Vt s8q_t ,
61.Vt u8q_t ,
62.Vt s16q_t ,
63.Vt u16q_t ,
64.Vt s32q_t ,
65.Vt u32q_t ,
66.Vt s64q_t ,
67and
68.Vt u64q_t ,
69which are referred to generically as
70.Fa QTYPE .
71.Pp
72For more details, see
73.Xr qmath 3 .
74.Sh RETURN VALUES
75.Fn Q_QABS
76function returns a QTYPE that is identical to that of
77.Fa q .
78.Pp
79The
80.Fn Q_Q2D
81and
82.Fn Q_Q2F
83functions return the double and float representations of
84.Fa q
85respectively.
86.Sh SEE ALSO
87.Xr errno 2 ,
88.Xr qmath 3 ,
89.Xr stdint 7
90.Sh HISTORY
91The
92.Xr qmath 3
93functions first appeared in
94.Fx 13.0 .
95.Sh AUTHORS
96.An -nosplit
97The
98.Xr qmath 3
99functions and this manual page were written by
100.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
101and sponsored by Netflix, Inc.
102