WP34S x=? in integer mode « Next Oldest | Next Newest »

 ▼ Harald Senior Member Posts: 455 Threads: 39 Joined: Jan 2011 03-13-2012, 09:48 AM I have written a little program to "benchmark" a few of my calculators. It simply adds all the integers from the start value down to 1. I am using x=0? to determin when to stop. Out of interest I wanted to see what happens if I put the calculator into integer mode and discovered something that I do not understand. x=0? returns "true" for x being -75. Can someone explain why that is? According to the manual I should use x=+0? or x=-0?, but haven't tried that yet (forgot the calculator at home) Cheers, Harald Edited: 13 Mar 2012, 9:48 a.m. ▼ Dominic Richens Member Posts: 228 Threads: 7 Joined: Aug 2011 03-13-2012, 11:35 AM notwithstanding what the manual says about x=-0 and x=+0, x=0? should still work as expected in integer mode. Not only does -75 x=0? return true, 0 x=0? returns false! ▼ Walter B Posting Freak Posts: 4,587 Threads: 105 Joined: Jul 2005 03-13-2012, 02:49 PM Good find :-) Strange things happening there: -16 x=0? returns (correctly) false, so what's happening in between? We'll look into that. Thanks for reporting! ▼ Marcus von Cube, Germany Posting Freak Posts: 3,283 Threads: 104 Joined: Jul 2005 03-13-2012, 02:56 PM I have an idea where to look but I need time to investigate it. Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-13-2012, 05:13 PM Fix committed but not built. This was a result of the rearrangement of the internal constants table recently. There was a second bug where the integer test against 1 was really against -1 :-( You only need to use x=+0? and x=-0? in special occasions and if you don't know or understand when, you don't need to use them :-) Just use x=0? instead. - Pauli ▼ Harald Senior Member Posts: 455 Threads: 39 Joined: Jan 2011 03-13-2012, 06:27 PM Quote: You only need to use x=+0? and x=-0? in special occasions and if you don't know or understand when, you don't need to use them :-) Just use x=0? instead. - Pauli So basically you are saying they are only interesting if I am using ones' complement because then I have both +0 and -0? But x=0? should be true for both +0 and -0? ▼ Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-13-2012, 06:46 PM Quote:So basically you are saying they are only interesting if I am using ones' complement because then I have both +0 and -0? But x=0? should be true for both +0 and -0? That is a third of the ways negative zero can appear. The sign & mantissa integer mode also has positive and negative zero. This isn't really any different to the 1s complement mode however. Real numbers have positive and negative zeros, which is invaluable for numerical programming. You'll have to set flag D to see the difference. And yes, x=0? is true for both positive and negative zero. - Pauli ▼ Harald Senior Member Posts: 455 Threads: 39 Joined: Jan 2011 03-13-2012, 06:57 PM Quote: Real numbers have positive and negative zeros, which is invaluable for numerical programming. You'll have to set flag D to see the difference. I never thought about that, but I suppose it helps to know which side you are approaching a limit from. Quote: And yes, x=0? is true for both positive and negative zero. - Pauli Ok, thanks for the info! Harald ▼ Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-13-2012, 07:00 PM Quote:...I suppose it helps to know which side you are approaching a limit from. Exactly. Very useful for complex branch cuts e.g. - Pauli

 Possibly Related Threads... Thread Author Replies Views Last Post Integration question and "RPN" mode comment Craig Thomas 16 2,991 12-05-2013, 02:32 AM Last Post: Nick_S HP Prime: Recommendation for future RPN Program Mode BruceTTT 3 920 11-13-2013, 10:03 PM Last Post: BruceTTT Program to change entry mode on Prime Michael de Estrada 3 908 10-28-2013, 10:13 AM Last Post: Han Prime: Exam mode (possible duplicate after funny response first time) Paul Townsend (UK) 1 676 10-24-2013, 03:09 PM Last Post: Tim Wessman Does RPN entry mode cause the Prime keyboard to lock up ? Michael de Estrada 14 2,237 10-22-2013, 06:27 PM Last Post: John Colvin HP Prime: Edit integer in RPN mode plivesey 15 2,198 10-18-2013, 04:34 PM Last Post: kris223 Temporary User Mode Key Programs not working in RPN BruceTTT 7 1,385 10-14-2013, 01:46 PM Last Post: BruceTTT HP Prime: MAKELIST in RPN mode? toml_12953 2 727 10-13-2013, 07:40 PM Last Post: BruceH Prime Edit Integer kris223 8 1,235 09-24-2013, 06:43 PM Last Post: kris223 Low battery slow mode Marcel Samek 4 844 09-18-2013, 02:02 PM Last Post: Harald

Forum Jump: