Author Topic: fPart and 1+int(abs(log(X  (Read 6932 times)

0 Members and 1 Guest are viewing this topic.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
fPart and 1+int(abs(log(X
« on: November 28, 2010, 03:56:48 pm »
Is there any way to test this (1+int(abs(log()))) nested inside of an fPart?

For example, this:
Code: [Select]
1+int(abs(log(fPart(Xdoesn't work.

This gets the # of digits in a number.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: fPart and 1+int(abs(log(X
« Reply #1 on: November 28, 2010, 03:58:30 pm »
I'm confused... What do you mean by your first line?
Also, for a positive integer, 1+int(log(X works.
What is X?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: fPart and 1+int(abs(log(X
« Reply #2 on: November 28, 2010, 03:58:51 pm »
so you want to get the number of digits in the fractional part of a number, am i right?


Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: fPart and 1+int(abs(log(X
« Reply #3 on: November 28, 2010, 04:00:58 pm »
so you want to get the number of digits in the fractional part of a number, am i right?

Yes.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: fPart and 1+int(abs(log(X
« Reply #4 on: November 28, 2010, 04:03:41 pm »
I don't think that's possible. You can tell how many leading 0's there are, but you can't tell how many significant figures there are.
log( won't distinguish much between .3333 and 1/3 x.x
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: fPart and 1+int(abs(log(X
« Reply #5 on: November 28, 2010, 04:06:26 pm »
i think you'd have to do the following, unless there's a neat math trick:

Code: [Select]
0->A
While fPart(X
10X->X
A+1->A
End

edit: and repeating decimals like 1/3 return 14 decimal places.
« Last Edit: November 28, 2010, 04:08:30 pm by nemo »


Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: fPart and 1+int(abs(log(X
« Reply #6 on: November 28, 2010, 04:10:44 pm »
Yeah, that's what I meant. No neat math trick, to my knowledge.
Your code should work fine, though. :)
Edit: I mean, we could use a nice recursive function...
Code: [Select]
f(x) = {0        x=int(x)}
       {1+f(x)  x<>int(x)}
« Last Edit: November 28, 2010, 04:13:15 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: fPart and 1+int(abs(log(X
« Reply #7 on: November 28, 2010, 04:12:25 pm »
With Celtic III/DCS7, you could do:
Code: [Select]
length(det(1,X))-1-length(det(1,1+int(abs(log(X
;D
« Last Edit: November 28, 2010, 04:12:47 pm by FinaleTI »


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: fPart and 1+int(abs(log(X
« Reply #8 on: November 28, 2010, 04:13:30 pm »
is that shorter than just using a loop though? it's probably faster granted


Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: fPart and 1+int(abs(log(X
« Reply #9 on: November 28, 2010, 04:22:28 pm »
That's probably larger than it needs to be.
How about:
Code: [Select]
length(det(1,X))-inString(det(1,X),".


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.