<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:37:25 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-1921] Decimal128 isZero</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1921</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;import github.com/rs/zerolog/log&lt;/p&gt;

&lt;p&gt;p := primitive.NewDecimal128(0, 0)&lt;/p&gt;

&lt;p&gt;log.Debug().&lt;br/&gt;
 Str(&quot;testData.TestPrimitiveDecimal128&quot;, testData.TestPrimitiveDecimal128.String()).&lt;br/&gt;
 Str(&quot;p&quot;, p.String()).&lt;br/&gt;
 Str(&quot;mongo.DecimalZero&quot;, Decimal128Zero.String()).&lt;br/&gt;
 Bool(&quot;p.IsZero&quot;, p.IsZero()).&lt;br/&gt;
 Bool(&quot;mongo.DecimalZero.IsZero&quot;, Decimal128Zero.IsZero()).&lt;br/&gt;
 Msg(&quot;init&quot;)&lt;/p&gt;

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;Running this code gives me the following:&lt;/p&gt;</description>
                <environment></environment>
        <key id="1649740">GODRIVER-1921</key>
            <summary>Decimal128 isZero</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="benji.rewis@mongodb.com">Benji Rewis</assignee>
                                    <reporter username="sweetat@withevo.com">Swee Tat Lim</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Mar 2021 11:52:54 +0000</created>
                <updated>Wed, 7 Apr 2021 04:44:48 +0000</updated>
                            <resolved>Wed, 24 Mar 2021 16:11:10 +0000</resolved>
                                    <version>1.5.0</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="3704618" author="JIRAUSER1259081" created="Wed, 7 Apr 2021 04:44:48 +0000"  >&lt;p&gt;Hi,&#160;&lt;/p&gt;

&lt;p&gt;&#160; My current idea of a fix will be to get a fork of mongo driver, and apply the patch you set up in pull 620&lt;/p&gt;</comment>
                            <comment id="3681790" author="benji.rewis" created="Wed, 24 Mar 2021 16:11:10 +0000"  >&lt;p&gt;Hello again &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sweetat%40withevo.com&quot; class=&quot;user-hover&quot; rel=&quot;sweetat@withevo.com&quot;&gt;sweetat@withevo.com&lt;/a&gt;! After further investigation, it seems that &lt;em&gt;all&lt;/em&gt; MongoDB drivers represent all zeros in bits (primitive.NewDecimal128(0,0)) as &#8220;0E-6176&#8221; when stringified.&lt;/p&gt;

&lt;p&gt;At the moment, it is unclear if this is a flaw in our interpretation of decimal128 arithmetic (our spec is based on conversions described &lt;a href=&quot;http://speleotrove.com/decimal/daconvs.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;) or a way of simplifying mathematic operations with a decimal128 of all zeroes.&lt;/p&gt;

&lt;p&gt;We will investigate further within the larger drivers department, but for now I am closing this smaller pull request.&lt;/p&gt;

&lt;p&gt;Let us know if you need help finding a workaround for this behavior in the meantime!&lt;/p&gt;</comment>
                            <comment id="3679413" author="benji.rewis" created="Tue, 23 Mar 2021 15:29:43 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sweetat%40withevo.com&quot; class=&quot;user-hover&quot; rel=&quot;sweetat@withevo.com&quot;&gt;sweetat@withevo.com&lt;/a&gt;&#160;Thanks again for your report! This does appear to be a bug; -6176 is the default exponent that never gets set when the decimal128 is zero. This means that the stringified version is OE-6176 when it should just be 0. A fix is in review.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/620&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/620&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3677639" author="esha.bhargava" created="Mon, 22 Mar 2021 20:16:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sweetat%40withevo.com&quot; class=&quot;user-hover&quot; rel=&quot;sweetat@withevo.com&quot;&gt;sweetat@withevo.com&lt;/a&gt; Thank you for reporting this issue. We&apos;ll look into this and get back to you soon.&lt;/p&gt;</comment>
                            <comment id="3666227" author="JIRAUSER1259081" created="Tue, 16 Mar 2021 11:56:06 +0000"  >&lt;p&gt;```&lt;/p&gt;

{&quot;level&quot;:&quot;debug&quot;,&quot;testData.TestPrimitiveDecimal128&quot;:&quot;16.72&quot;,&quot;p&quot;:&quot;0E-6176&quot;,&quot;mongo.DecimalZero&quot;:&quot;0&quot;,&quot;p.IsZero&quot;:true,&quot;mongo.DecimalZero.IsZero&quot;:false,&quot;time&quot;:&quot;2021-03-16T19:44:54+08:00&quot;,&quot;message&quot;:&quot;init&quot;}

&lt;p&gt;```&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;p gives an odd &quot;0E-6176&quot; when converted to string.&#160; Why is that the case?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;My expectation with the use of IsZero function is that it should provide the number where decimal representation is zero.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyku73:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>