DMUG-Archiv 2026

Frühere   Chronologischer Index   Spätere
Vorherige   Thematischer Index   Nächste

[Dmug] overdoing of Short[]

Liebe Freundinnen und Freunde wahrlich randständiger Bemerkungen,

Angenommen, es gäbe eine Funktion

In[47]:= Clear[rootsOfI]
rootsOfI::nosol := "Solve runs empty for n = `1`";
rootsOfI[n_Integer?Positive] := Block[{s = x /. Solve[x^n - I == 0, x]},
  If[Length[s] == 0,
   Message[rootsOfI::nosol, n];
   Return[$Failed], (* else *)
   Print["The roots are ", Short[s]]
   ];
  Graphics[{Circle[],
    {PointSize[.03], Red, Point[{0, 1}]},
    {PointSize[.03], Blue, Point[ReIm /@ s]}
    },
   Axes -> True]
  ]

und man schaute sich die Angaben von Short[s] an, dann sähe das mit

In[48]:= $Version
Out[48]= "14.3.0 for Microsoft Windows (64-bit) (July 8, 2025)"

erst gut aus

rootsOfI[4]
The roots are {-(-1)^(1/8),(-1)^(1/8),-(-1)^(5/8),(-1)^(5/8)}

dann nicht

rootsOfI[10]
The roots are {-(-1)^(1/20),(-1)^(1/20),-(-1)^(1/4),(-1)^(1/4),-<<1>>^<<1>>,<<1>>,-(-1)^(13/20),(-1)^(13/20),-(-1)^(17/20),(-1)^(17/20)}

und wieder nicht

rootsOfI[11]
The roots are {-I,(-1)^(1/22),-(-1)^(3/22),(-1)^(5/22),-<<1>>,<<1>>^<<1>>,<<1>>^<<1>>,-(-1)^(15/22),(-1)^(17/22),-(-1)^(19/22),(-1)^(21/22)}

das nimmt übrigens widerreferentiell 2 Zeilen ein ... und ab 12 ist es dann in Ordnung

rootsOfI[12]
The roots are {-(-1)^(1/24),(-1)^(1/24),-(-1)^(5/24),(-1)^(5/24),<<4>>,-(-1)^(17/24),(-1)^(17/24),-(-1)^(7/8),(-1)^(7/8)}

z.B.

rootsOfI[21]
The roots are {I,(-1)^(1/42),-(-1)^(1/14),(-1)^(5/42),-(-1)^(1/6),<<12>>,-(-1)^(5/6),(-1)^(37/42),-(-1)^(13/14),(-1)^(41/42)}


Frohe Ostern!

Udo.


_______________________________________________
DMUG Deutschsprachiges Mathematica-Forum demug@XXXXXXX.ch
http://www.mathematica.ch/mailman/listinfo/demug
Archiv: http://www.mathematica.ch/archiv.html

Frühere   Chronologischer Index   Spätere
Vorherige   Thematischer Index   Nächste

DMUG DMUG-Archiv, http://www.mathematica.ch/archiv.html