相关疑难解决方法(0)

如何对有理数进行"工作"重复十进制表示?

我已经想出如何使用OverBar显示重复小数的重复部分.

repeatingDecimal实际上不作为重复小数.我想做一个看起来和行为像重复小数的变体.


我如何才能让一个工作重复的十进制表示(可能使用Interpretation[])?


背景

如果我絮絮叨叨,请原谅.这是我的第一个问题,我想明确我的想法.

以下将"绘制"重复的小数.

repeatingDecimal[q2_] :=
 Module[{a},
  a[{{nr__Integer}, pt_}] := 
   StringJoin[
    Map[ToString, 
     If[pt > -1, Insert[{nr}, ".", pt + 1], 
      Join[{"."}, Table["0", {Abs[pt]}], {nr}]]]];
  (* repeating only *)

  a[{{{r__Integer}}, pt_}] := 
   Row[{".", OverBar@StringJoin[Map[ToString, {r}]]}];

  (* One or more non-repeating; 
  more than one repeating digit KEEP IN THIS ORDER!! *)
  a[{{nr__, {r__}}, pt_}] := 
   Row[{StringJoin[
      Map[ToString, 
       If[pt > -1, Insert[{nr}, ".", pt + 1], 
        Join[{"."}, Table["0", {Abs[pt]}], {nr}]]]], 
     OverBar@StringJoin[Map[ToString, {r}]]}];
  (* …
Run Code Online (Sandbox Code Playgroud)

math wolfram-mathematica decimal decimal-point fractions

12
推荐指数
1
解决办法
1929
查看次数