Post Reply 
MC: Why different? Why not a bug?
04-15-2018, 08:59 PM (This post was last modified: 04-15-2018 10:34 PM by Joe Horn.)
Post: #1
MC: Why different? Why not a bug?
The screen shot below was taken in Home view. Notice that the last two results are different. This might SEEM like a bug, but it's not.

Mini-challenge: explain (a) why they are different, and (b) why this is NOT a bug.

[Image: notabug.png]

Hint #1: The same results are obtained regardless of the currently active app.

Hint #2: No, the results were not obtained on different sides of midnight. Big Grin The whole thing was done during the same Date.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
04-16-2018, 02:51 AM (This post was last modified: 04-16-2018 02:53 AM by Mark Hardman.)
Post: #2
RE: MC: Why different? Why not a bug?
(04-15-2018 08:59 PM)Joe Horn Wrote:  The screen shot below was taken in Home view. Notice that the last two results are different. This might SEEM like a bug, but it's not.

Mini-challenge: explain (a) why they are different, and (b) why this is NOT a bug.

ifactor is a CAS function and its arguments are evaluated in CAS mode. Because CAS mode does not use BCD, the result of Date*10000 is internally represented as 20180414.999999880791 and ifactor(IP(Date*10000)) is evaluated as ifactor(20180414)--which results in an unexpected result. If you first evaluate IP(Date*10000) in Home, the correct BCD result of 20180415 is assigned to Ans and evaluating ifactor(20180415) returns the correct result. This is not a bug. It is simply the difference in how numbers are stored in Home vs. CAS. An excellent example of something that should be considered when using CAS commands in Home.

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
04-16-2018, 03:33 AM
Post: #3
RE: MC: Why different? Why not a bug?
Mark: Exactly correct, and clearly explained! Well done! Smile

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)