Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Don't make me REPETEND myself...
#12
@Stuart

Great post! Woohoo, my routine was able to identify .000000000000001184237892933500309785207112630208333333 as an eventual infinite repetend of 3s.

.000000000000001184237892933500309785207112630208333333

So for fun, let's turn that decimal into a fraction...

10^48 * .000000000000001184237892933500309785207112630208333333 = 1184237892933500309785207112630208.333333
10^ 50 * .000000000000001184237892933500309785207112630208333333 = 118423789293350030978520711263020833.3333

118423789293350030978520711263020833.333333
- 1184237892933500309785207112630208.333333
------------------------------------------------------------
117239551400416530668735504150390625

99000000000000000000000000000000000000000000000000 / 117239551400416530668735504150390625 =

1 / 844424930131968

I bring this up because since I'm not onboard with resorting to bit turning math, or whatever it's called, I'm getting curious about converting to fractions to round repetends. As such...

1 / 3 * 3

digital = 1 / 3 = .3... but * 3 = .999... unless the repetend is handled properly in multiplying back to 1.

So with fractions,

1 3
- * - = 1 No problem.
3 1

so if I write an algorithm that does the following...

.3... * 3

10x * .3... = 3.3...
1000x * .3 = 333.3
333.3
- 3.3 = 330
1000x
- 10x = 990x
990x = 330
330 / 990 reduced = 1 /3
1 / 3 * 3 = 3 /3 = 1
So converting to fraction multiplication now 1 / 3 * 3 = 1 instead of .9...

Well, easy in theory, but when we get into really big number repetends, it might be difficult and slow to implement.

Pete
Reply


Messages In This Thread
Don't make me REPETEND myself... - by Pete - 07-31-2022, 08:57 PM
RE: Don't make me REPETEND myself... - by bplus - 07-31-2022, 11:20 PM
RE: Don't make me REPETEND myself... - by Pete - 08-01-2022, 01:00 AM
RE: Don't make me REPETEND myself... - by bplus - 08-01-2022, 03:57 PM
RE: Don't make me REPETEND myself... - by Pete - 08-01-2022, 07:10 PM
RE: Don't make me REPETEND myself... - by Jack - 08-01-2022, 07:47 PM
RE: Don't make me REPETEND myself... - by Pete - 08-03-2022, 12:30 AM
RE: Don't make me REPETEND myself... - by Jack - 08-03-2022, 01:39 AM
RE: Don't make me REPETEND myself... - by Pete - 08-03-2022, 02:49 AM
RE: Don't make me REPETEND myself... - by Stuart - 08-03-2022, 08:21 AM
RE: Don't make me REPETEND myself... - by Dav - 08-03-2022, 10:37 AM
RE: Don't make me REPETEND myself... - by Pete - 08-03-2022, 05:39 PM
RE: Don't make me REPETEND myself... - by Pete - 08-03-2022, 06:48 PM
RE: Don't make me REPETEND myself... - by Pete - 08-03-2022, 10:43 PM
RE: Don't make me REPETEND myself... - by Stuart - 08-04-2022, 07:13 AM
RE: Don't make me REPETEND myself... - by Pete - 08-04-2022, 08:37 AM
RE: Don't make me REPETEND myself... - by Jack - 08-04-2022, 09:23 AM
RE: Don't make me REPETEND myself... - by Stuart - 08-04-2022, 10:30 AM
RE: Don't make me REPETEND myself... - by bplus - 08-04-2022, 01:26 PM
RE: Don't make me REPETEND myself... - by Pete - 08-04-2022, 06:30 PM
RE: Don't make me REPETEND myself... - by Pete - 08-04-2022, 09:17 PM
RE: Don't make me REPETEND myself... - by Jack - 08-04-2022, 10:37 PM
RE: Don't make me REPETEND myself... - by Pete - 08-05-2022, 10:05 AM
RE: Don't make me REPETEND myself... - by Pete - 08-14-2022, 11:48 AM



Users browsing this thread: 4 Guest(s)