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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Don't let INKEY$ byte you in the ASCII Pete 1 169 02-01-2026, 10:44 PM
Last Post: PhilOfPerth
  Make windows .exe using Linux version? Circlotron 7 507 01-15-2026, 09:42 PM
Last Post: ahenry3068
  Don't fall for the mid$ trap doppler 10 1,450 10-19-2025, 08:21 PM
Last Post: Pete
  Don't look now developers, but you've got a pat on your back! Pete 7 1,277 12-15-2024, 09:59 AM
Last Post: TempodiBasic
Bug SCREEN() function doesn't make nice with _FONT in graphic modes mnrvovrfc 5 1,325 05-30-2023, 11:42 AM
Last Post: sivacc

Forum Jump:


Users browsing this thread: 1 Guest(s)