﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 5  » Incorrect assignment from response to   variable</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Fri, 25 Sep 2026 06:37:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Incorrect assignment from response to   variable</title><link>https://forums.millisecond.com/Topic25399.aspx</link><description>I'm having a problem where I'm assigning a slider response to a &amp;lt;values&amp;gt; item, but in the &amp;lt;summarydata&amp;gt; file the value saved is slightly off the actual response.&lt;br/&gt;&lt;br/&gt;The command I'm using is:&lt;br/&gt;values.unknown30bet = surveypage.unknown_urn_page.response/100&lt;br/&gt;&lt;br/&gt;As an example, when looking in the raw data file I can see that the response was (accurately) saved as 647, but the value stored in the summary data file for values.unknown30bet is&amp;nbsp;6.4699999999999997513.&lt;br/&gt;&lt;br/&gt;I've attached the code in case it helps, but I'm a bit of an amateur so I'm aware that it might be a bit messy!&lt;br/&gt;&lt;br/&gt;Thanks in advance</description><pubDate>Mon, 13 Aug 2018 23:36:31 GMT</pubDate><dc:creator>allthedecs</dc:creator></item><item><title>RE: Incorrect assignment from response to   variable</title><link>https://forums.millisecond.com/Topic25402.aspx</link><description>Oh ok great, thanks for explaining!</description><pubDate>Mon, 13 Aug 2018 23:36:31 GMT</pubDate><dc:creator>allthedecs</dc:creator></item><item><title>RE: Incorrect assignment from response to   variable</title><link>https://forums.millisecond.com/Topic25401.aspx</link><description>&lt;div data-id="25400" class="if-quote-wrapper" unselectable="on" data-guid="1534224060483"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25400" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="25400" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="25400" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, August 13, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25400"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="25399" class="if-quote-wrapper" unselectable="on" data-guid="1534224060483"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25399" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="25399" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="25399" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;allthedecs - Monday, August 13, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25399"&gt;&lt;div class="if-quote-message-margin"&gt;I'm having a problem where I'm assigning a slider response to a &amp;lt;values&amp;gt; item, but in the &amp;lt;summarydata&amp;gt; file the value saved is slightly off the actual response.&lt;br/&gt;&lt;br/&gt;The command I'm using is:&lt;br/&gt;values.unknown30bet = surveypage.unknown_urn_page.response/100&lt;br/&gt;&lt;br/&gt;As an example, when looking in the raw data file I can see that the response was (accurately) saved as 647, but the value stored in the summary data file for values.unknown30bet is&amp;nbsp;6.4699999999999997513.&lt;br/&gt;&lt;br/&gt;I've attached the code in case it helps, but I'm a bit of an amateur so I'm aware that it might be a bit messy!&lt;br/&gt;&lt;br/&gt;Thanks in advance&lt;a class="if-quote-goto quote-link" href="#" data-id="25399"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;That's normal and a consequence of how computers represent integers (e.g. 647) vs real numbers (e.g. 6.47). For computers, everything comes down to binary, and it simply is the case that not every real number can be represented *precisely* as a binary value. (See &lt;a href="https://en.wikipedia.org/wiki/Floating_point_numbers#Accuracy_problems"&gt;&lt;a href="https://en.wikipedia.org/wiki/Floating_point_numbers#Accuracy_problems"&gt;https://en.wikipedia.org/wiki/Floating_point_numbers#Accuracy_problems&lt;/a&gt;&lt;/a&gt; for some canonical examples.) Basically, you incur a small loss of precision when you go from integers -&amp;gt; floating point representations, varying with the type of mathematical operation involved. All computer programs that do math deal with this, although you will often not notice because extra rounding or other tricks programs perform behind the scenes will hide those things from the user.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25400"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;To add, if this bothers you, you can do what many applications will do to mask the issue and apply formatting to the floating point result like so:&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage unknown_urn_page&amp;gt;&lt;br/&gt;/ stimulustimes = [0 = unknown_urn_pics, urncontents_label, unknownodds, quittext, maintask_header]&lt;br/&gt;/ questions = [1 = slider.bet_slider]&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ nextbuttonposition = (40%, 90%)&lt;br/&gt;/ finishlabel = "Place bet"&lt;br/&gt;/ navigationbuttonsize = (20%, 6%)&lt;br/&gt;/ navigationbuttonfontstyle = ("Arial", 3.33%, false, false, false, false, 5, 1)&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (list.unknownorderlist.nextvalue == 1) {values.unknown30bet = &lt;strong&gt;format("%.2f", surveypage.unknown_urn_page.response/100)&lt;/strong&gt;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (list.unknownorderlist.nextvalue == 2) {values.unknown40bet = &lt;strong&gt;format("%.2f", surveypage.unknown_urn_page.response/100)&lt;/strong&gt;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (list.unknownorderlist.nextvalue == 3) {values.unknown50bet = &lt;strong&gt;format("%.2f", surveypage.unknown_urn_page.response/100)&lt;/strong&gt;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (list.unknownorderlist.nextvalue == 4) {values.unknown60bet =&lt;strong&gt; format("%.2f", surveypage.unknown_urn_page.response/100)&lt;/strong&gt;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (list.unknownorderlist.nextvalue == 5) {values.unknown70bet = &lt;strong&gt;format("%.2f", surveypage.unknown_urn_page.response/100)&lt;/strong&gt;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;</description><pubDate>Mon, 13 Aug 2018 22:22:47 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Incorrect assignment from response to   variable</title><link>https://forums.millisecond.com/Topic25400.aspx</link><description>&lt;div data-id="25399" class="if-quote-wrapper" unselectable="on" data-guid="1534222206328"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25399" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="25399" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="25399" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;allthedecs - Monday, August 13, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25399"&gt;&lt;div class="if-quote-message-margin"&gt;I'm having a problem where I'm assigning a slider response to a &amp;lt;values&amp;gt; item, but in the &amp;lt;summarydata&amp;gt; file the value saved is slightly off the actual response.&lt;br/&gt;&lt;br/&gt;The command I'm using is:&lt;br/&gt;values.unknown30bet = surveypage.unknown_urn_page.response/100&lt;br/&gt;&lt;br/&gt;As an example, when looking in the raw data file I can see that the response was (accurately) saved as 647, but the value stored in the summary data file for values.unknown30bet is&amp;nbsp;6.4699999999999997513.&lt;br/&gt;&lt;br/&gt;I've attached the code in case it helps, but I'm a bit of an amateur so I'm aware that it might be a bit messy!&lt;br/&gt;&lt;br/&gt;Thanks in advance&lt;a class="if-quote-goto quote-link" href="#" data-id="25399"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;That's normal and a consequence of how computers represent integers (e.g. 647) vs real numbers (e.g. 6.47). For computers, everything comes down to binary, and it simply is the case that not every real number can be represented *precisely* as a binary value. (See &lt;a href="https://en.wikipedia.org/wiki/Floating_point_numbers#Accuracy_problems"&gt;&lt;a href="https://en.wikipedia.org/wiki/Floating_point_numbers#Accuracy_problems"&gt;https://en.wikipedia.org/wiki/Floating_point_numbers#Accuracy_problems&lt;/a&gt;&lt;/a&gt; for some canonical examples.) Basically, you incur a small loss of precision when you go from integers -&amp;gt; floating point representations, varying with the type of mathematical operation involved. All computer programs that do math deal with this, although you will often not notice because extra rounding or other tricks programs perform behind the scenes will hide those things from the user.&lt;br/&gt;</description><pubDate>Mon, 13 Aug 2018 21:59:06 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>