You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- :meth:`Instance.setFromJson`, if the values are provided as strings, e.g., ``the_output.instance.setFromJson({my_uint64: '18446744073709551615'})``.
210
+
211
+
64-bit values with an absolute value greater than 2^53 can be retrieved via:
212
+
- The type-agnostic getter, :meth:`SampleIterator.get`. If the absolute value of
213
+
the field is less than ``2^53`` it will be returned as a number; otherwise it will be
214
+
returned as a string, e.g., ``sample.get(0).get('my_int64') // '9223372036854775807' OR 1234``.
215
+
- Using :meth:`SampleIterator.getString`. The value will be returned as a string,
216
+
e.g., ``sample.getString(my_int64') // '9223372036854775807' OR '1234'``.
201
217
202
-
64-bit values larger than 2^53 can be set via:
203
-
- The type-agnostic setter (``instance.set()``), if they are supplied as strings, e.g., ``the_output.instance.set('my_uint64', '18446744073709551615')``.
204
-
- The ``setString`` setter, e.g., ``the_output.instance.setString('my_uint64', '18446744073709551615')``.
205
-
- Via a ``setFromJson``, if they are provided as strings, e.g., ``the_output.instance.setFromJson({my_uint64: '18446744073709551615'})``.
218
+
.. warning::
219
+
220
+
If :meth:`SampleIterator.getNumber()` is used to retrieve a value > 2^53 it will
221
+
throw a :class:`DDSError`.
222
+
223
+
.. warning::
206
224
207
-
64-bit values larger than 2^53 can be retrieved via:
208
-
- The type-agnostic getter, ``getValue``. If the value is smaller than 2^53, it will be returned as a number; otherwise it will be returned as a string:
209
-
e.g., ``sample.get(0).get('my_int64') // e.g., '9223372036854775807' OR 1234``.
210
-
- The ``getString`` method.
211
-
The value will be returned as a string, e.g., ``sample.getString(my_int64') // '9223372036854775807'``.
225
+
If :meth:`Instance.setNumber()` is used to set a value >= 2^53 it will throw a
226
+
:class:`DDSError`.
212
227
213
228
.. warning::
214
229
215
-
If getNumber or setNumber is used with a value larger than 2^53, that value will produce an ``Error``.
230
+
The :meth:`SampleIterator.getJson()` method should not be used to retrieve integer
231
+
values larger than ``Number.MAX_SAFE_INTEGER`` (or smaller than ``Number.MIN_SAFE_INTEGER``).
232
+
The values returned may be corrupted **but no error will be thrown**.
233
+
234
+
.. note::
235
+
236
+
The :meth:`Instance.setNumber()` operation can safely handle ``abs(value) < 2^53``,
237
+
whereas the :meth:`SampleIterator.getNumber()` operation can safely handle ``abs(value) <= 2^53``.
0 commit comments