@@ -8,58 +8,58 @@ The fundamental types provided by NumPy QuadDType.
88.. class:: numpy_quaddtype.QuadPrecision(value, backend="sleef")
99
1010 A quad-precision (128-bit) floating-point scalar.
11-
11+
1212 QuadPrecision is a NumPy scalar type that provides IEEE 754 binary128
1313 floating-point arithmetic. It can be used standalone or as elements
1414 of NumPy arrays.
15-
16- :param value: The value to convert to quad precision. Can be:
17-
15+
16+ :param value: The value to convert to quad precision. It can be:
17+
1818 - ``float`` or ``int``: Python numeric types
1919 - ``str``: String representation for maximum precision
2020 - ``bytes``: Raw 16-byte representation
2121 - ``numpy.floating`` or ``numpy.integer``: NumPy numeric types
2222 - ``QuadPrecision``: Another QuadPrecision value
23-
2423 :type value: float, int, str, bytes, numpy scalar, or QuadPrecision
24+
2525 :param backend: Computation backend to use. Either ``"sleef"`` (default)
2626 or ``"longdouble"``.
2727 :type backend: str, optional
28-
28+
2929 **Examples**
30-
30+
3131 Create from different input types::
32-
32+
3333 >>> from numpy_quaddtype import QuadPrecision
3434 >>> QuadPrecision(3.14)
3535 QuadPrecision('3.14000000000000012434...')
3636 >>> QuadPrecision("3.14159265358979323846264338327950288")
3737 QuadPrecision('3.14159265358979323846264338327950288')
3838 >>> QuadPrecision(42)
3939 QuadPrecision('42.0')
40-
40+
4141 Arithmetic operations::
42-
42+
4343 >>> x = QuadPrecision("1.5")
4444 >>> y = QuadPrecision("2.5")
4545 >>> x + y
4646 QuadPrecision('4.0')
4747 >>> x * y
4848 QuadPrecision('3.75')
49-
49+
5050 .. attribute:: dtype
5151 :type: QuadPrecDType
52-
52+
5353 The NumPy dtype for this scalar.
54-
54+
5555 .. attribute:: real
5656 :type: QuadPrecision
57-
58- The real part (returns self for real numbers ).
59-
57+
58+ The real part (always self for QuadPrecision ).
59+
6060 .. attribute:: imag
6161 :type: QuadPrecision
62-
62+
6363 The imaginary part (always zero for QuadPrecision).
6464```
6565
@@ -69,45 +69,45 @@ The fundamental types provided by NumPy QuadDType.
6969.. class:: numpy_quaddtype.QuadPrecDType(backend="sleef")
7070
7171 NumPy dtype for quad-precision floating-point arrays.
72-
73- QuadPrecDType is a custom NumPy dtype that enables creation and
72+
73+ QuadPrecDType is a custom NumPy dtype that enables the creation and
7474 manipulation of arrays containing quad-precision values.
75-
75+
7676 :param backend: Computation backend. Either ``"sleef"`` (default) or
7777 ``"longdouble"``.
7878 :type backend: str, optional
79-
79+
8080 **Examples**
81-
81+
8282 Create arrays with QuadPrecDType::
83-
83+
8484 >>> import numpy as np
8585 >>> from numpy_quaddtype import QuadPrecDType
8686 >>> arr = np.array([1, 2, 3], dtype=QuadPrecDType())
8787 >>> arr.dtype
8888 QuadPrecDType128
8989 >>> np.zeros(5, dtype=QuadPrecDType())
9090 array([0.0, 0.0, 0.0, 0.0, 0.0], dtype=QuadPrecDType128)
91-
91+
9292 .. attribute:: backend
9393 :type: QuadBackend
94-
95- The computation backend (SLEEF or LONGDOUBLE).
96-
94+
95+ The computation backend (``QuadBackend. SLEEF`` or ``QuadBackend. LONGDOUBLE`` ).
96+
9797 .. attribute:: itemsize
9898 :type: int
99-
100- Size of each element in bytes (always 16).
101-
99+
100+ The size of each element in bytes (always 16).
101+
102102 .. attribute:: alignment
103103 :type: int
104-
105- Memory alignment in bytes (always 16).
106-
104+
105+ The memory alignment in bytes (always 16).
106+
107107 .. attribute:: name
108108 :type: str
109-
110- String name of the dtype (``"QuadPrecDType128"``).
109+
110+ The string name of the dtype (``"QuadPrecDType128"``).
111111```
112112
113113## QuadBackend
@@ -116,22 +116,22 @@ The fundamental types provided by NumPy QuadDType.
116116.. class:: numpy_quaddtype.QuadBackend
117117
118118 Enumeration of available computation backends.
119-
119+
120120 .. attribute:: SLEEF
121121 :value: 0
122-
122+
123123 SLEEF library backend (default). Provides true IEEE 754 binary128
124124 quad precision with SIMD optimization.
125-
125+
126126 .. attribute:: LONGDOUBLE
127127 :value: 1
128-
129- Platform 's native long double backend. Precision varies by platform.
130-
128+
129+ The platform 's native long double backend. The precision varies by platform.
130+
131131 **Example**
132-
132+
133133 ::
134-
134+
135135 >>> from numpy_quaddtype import QuadPrecDType, QuadBackend
136136 >>> dtype = QuadPrecDType()
137137 >>> dtype.backend == QuadBackend.SLEEF
@@ -146,9 +146,9 @@ The fundamental types provided by NumPy QuadDType.
146146.. function:: numpy_quaddtype.SleefQuadPrecision(value)
147147
148148 Create a QuadPrecision scalar using the SLEEF backend.
149-
149+
150150 Equivalent to ``QuadPrecision(value, backend="sleef")``.
151-
151+
152152 :param value: Value to convert to quad precision.
153153 :return: Quad precision scalar using SLEEF backend.
154154 :rtype: QuadPrecision
@@ -160,9 +160,9 @@ The fundamental types provided by NumPy QuadDType.
160160.. function:: numpy_quaddtype.LongDoubleQuadPrecision(value)
161161
162162 Create a QuadPrecision scalar using the longdouble backend.
163-
163+
164164 Equivalent to ``QuadPrecision(value, backend="longdouble")``.
165-
165+
166166 :param value: Value to convert to quad precision.
167167 :return: Quad precision scalar using longdouble backend.
168168 :rtype: QuadPrecision
@@ -174,9 +174,9 @@ The fundamental types provided by NumPy QuadDType.
174174.. function:: numpy_quaddtype.SleefQuadPrecDType()
175175
176176 Create a QuadPrecDType using the SLEEF backend.
177-
177+
178178 Equivalent to ``QuadPrecDType(backend="sleef")``.
179-
179+
180180 :return: Dtype for SLEEF-backed quad precision arrays.
181181 :rtype: QuadPrecDType
182182```
@@ -187,9 +187,9 @@ The fundamental types provided by NumPy QuadDType.
187187.. function:: numpy_quaddtype.LongDoubleQuadPrecDType()
188188
189189 Create a QuadPrecDType using the longdouble backend.
190-
190+
191191 Equivalent to ``QuadPrecDType(backend="longdouble")``.
192-
192+
193193 :return: Dtype for longdouble-backed quad precision arrays.
194194 :rtype: QuadPrecDType
195195```
0 commit comments