Post Reply 
Break line (HP50)
10-29-2020, 08:15 PM
Post: #10
RE: Break line (HP50)
(10-29-2020 12:16 PM)DavidM Wrote:  
(10-28-2020 02:16 AM)Artur - Brasil Wrote:  ...like comparing two data: 1. == 1 returns false.

Not sure about earlier ROM versions, but v2.15 returns a boolean true value (1 or 1.) on a 50g for the above test.

SAME, on the other hand, does not. SAME can be thought of as "do the two objects have the SAME bit-for-bit representation?" It doesn't attempt to interpret the arguments at all, and simply checks the data as represented on the calculator to see if the bit streams are identical for both objects.

The "==" operator is less strict, and will attempt to simplify some objects before determining equivalency. As an example, 1 '3-2' == returns a boolean true value, despite the two objects being tested having very different internal representations.

Considering the above, another distinct difference between SAME and == becomes apparent: SAME is much faster, and is generally better to use when you are checking objects of the same type for equivalency. This is usually not an issue unless you are mixing approximate numbers and exact integers in your calculations.

You're right, Dave. I'll see my code and check where I had to take care about 1. and 1 ...
See you soon!
Best wishes,
Artur

ARTUR MARIO JUNIOR
BRAZIL
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Break line (HP50) - CMarangon - 10-27-2020, 12:36 AM
RE: Break line (HP50) - Gerson W. Barbosa - 10-27-2020, 02:07 AM
RE: Break line (HP50) - CMarangon - 10-27-2020, 04:42 PM
RE: Break line (HP50) - CMarangon - 10-27-2020, 05:16 PM
RE: Break line (HP50) - Gerson W. Barbosa - 10-27-2020, 08:03 PM
RE: Break line (HP50) - Artur - Brasil - 10-28-2020, 02:16 AM
RE: Break line (HP50) - CMarangon - 10-28-2020, 04:40 AM
RE: Break line (HP50) - Valentin Albillo - 10-29-2020, 12:00 AM
RE: Break line (HP50) - DavidM - 10-29-2020, 12:16 PM
RE: Break line (HP50) - Artur - Brasil - 10-29-2020 08:15 PM



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