This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Calculator Tech Support => Technology & Calculator Open Topic
Author Message
RedDwarf


Newbie


Joined: 12 May 2008
Posts: 2

Posted: 17 May 2008 12:19:53 am    Post subject:

So, I was messing around with some program or another on my 84+SE and ended up doing something where I took the iPart of log(16)/log(2). Confused when the program didn't work, I went to the home screen and did iPart(log(16)/log(2)) - which should return 4 - and it returned 3. I then tried fPart(log(16)/log(2)) and that returned 1. What's going on here? I tried it on several different 83+ series calculators and all of them did the same thing. My friend's 89 Titanium, however, worked properly. I admit myself to be thoroughly confused. Maybe this has been discussed before but I couldn't find anything.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 17 May 2008 01:36:22 am    Post subject:

Welcome to United-TI! :)

The TI-83+ and similar models (which includes the TI-84+SE) use floating-point arithmetic, which means that calculations are only accurate to a certain number of decimal places. If it's off by a mere 10-14, then this could cause the unexpected behavior like what you described. To correct this behavior, oftentimes all you need is round(value,#decimals, where the second argument defaults to 10 if left omitted, which by itself is usually sufficient. So, try using iPart(round(log(16)/log(2 instead.

About the fPart( being equal to one: log(16)/log(2) actually evaluates to 3.9999999999999 on the calculator, and the fractional part is very close to an integer, so it will be displayed as such. While up to 14 digits are retained between calculations, the home screen will only display up to 10. However, the result itself isn't rounded – just the display is.


Last edited by Guest on 02 Aug 2010 02:06:03 am; edited 1 time in total
Back to top
RedDwarf


Newbie


Joined: 12 May 2008
Posts: 2

Posted: 17 May 2008 01:47:26 am    Post subject:

That's pretty much what I expected and round is exactly what I need for this program. But as far as I can tell, this only happens for 16: iPart(log(32)/log(2))=5, iPart(log(64)/log(2))=6, etc. Why just 16?
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 17 May 2008 01:53:45 am    Post subject:

Actually, it messes up slightly in the positive direction for exponents of six through eight, and then fails to reach its mark at nine, but gets its act together for every input past that. I couldn't offer an explanation as to why that is. There'd likely be problems for powers of other bases as well. I'll look more into this. (Edit: The distribution's a mess – can't find a pattern.)

Last edited by Guest on 17 May 2008 02:38:16 am; edited 1 time in total
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 17 May 2008 09:31:34 am    Post subject:

For some "fun", try plotting iPart(log(X^N)/log(X)) for various values of N (not just integers). You'd be surprised at how often you'll see "combs".

I have a feeling it's the approximation algorithm within log( (and ln(, for that matter) that causes the trouble. Without a way to find out what TI exactly uses (I don't think they'd tell. Razz ), you won't make headway towards understanding why this is so.

thornahawk
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement