@@ -528,29 +528,29 @@ BSON::Decimal128 vs BigDecimal
528528The ``BigDecimal`` ``from_bson`` and ``to_bson`` methods use the same
529529``BSON::Decimal128`` methods under the hood. This leads to some limitations
530530that are imposed on the ``BigDecimal`` values that can be serialized to BSON
531- and those that can be deserialized from existing ``BSON::Decimal128 `` BSON
532- objects . This change was made because serializing ``BigDecimal`` instances as
531+ and those that can be deserialized from existing ``decimal128 `` BSON
532+ values . This change was made because serializing ``BigDecimal`` instances as
533533``BSON::Decimal128`` instances allows for more flexibility in terms of querying
534534and aggregation in MongoDB. The limitations imposed on ``BigDecimal`` are as
535535follows:
536536
537- - ``BSON::Decimal128 `` has a limited range and precision, while ``BigDecimal``
538- has no restrictions in terms of range and precision. ``BSON::Decimal128 `` has
539- a max value of approximately ``10^6145`` and a min value of approximately
540- ``-10^6145``, and has a maximum of 34 bits of precision.
537+ - ``decimal128 `` has a limited range and precision, while ``BigDecimal`` has no
538+ restrictions in terms of range and precision. ``decimal128 `` has a max value
539+ of approximately ``10^6145`` and a min value of approximately ``-10^6145``,
540+ and has a maximum of 34 bits of precision.
541541
542- - ``BSON::Decimal128 `` is able to accept signed ``NaN`` values, while
543- ``BigDecimal`` is not. All signed ``NaN`` values that are deserialized into
544- ``BigDecimal`` instances will be unsigned.
542+ - ``decimal128 `` is able to accept signed ``NaN`` values, while ``BigDecimal``
543+ is not. All signed ``NaN`` values that are deserialized into ``BigDecimal``
544+ instances will be unsigned.
545545
546- - ``BSON::Decimal128 `` maintains trailing zeroes when serializing to and
546+ - ``decimal128 `` maintains trailing zeroes when serializing to and
547547 deserializing from BSON. ``BigDecimal``, however, does not maintain trailing
548548 zeroes and therefore using ``BigDecimal`` may result in a lack of precision.
549549
550550.. note::
551551
552- In BSON 5.0, ``BSON::Decimal128 `` is deserialized into ``BigDecimal`` by
553- default. In order to have ``BSON::Decimal128 `` values in BSON documents
552+ In BSON 5.0, ``decimal128 `` will be deserialized into ``BigDecimal`` by
553+ default. In order to have ``decimal128 `` values in BSON documents
554554 deserialized into ``BSON::Decimal128``, the ``mode: :bson`` option can be set
555555 on ``from_bson``.
556556
0 commit comments