Anonymous user
Formal power series/D: Difference between revisions
m
→{{header|D}}: oops, typo
m (→{{header|D}}: fix no effect on reseting) |
m (→{{header|D}}: oops, typo) |
||
Line 223:
// these will reset privous defintion
COS = F(Rational(
SIN = COS.integ ;
writefln("SIN (reset) : %s", SIN) ;
Line 229:
writefln("SIN : %s", SIN) ;
writefln("COS : %s", COS) ;
writefln("C*C + S*S : %s", SIN*SIN + COS*COS) ; // => 1
}</lang>
Output:
<pre>SIN : x -1/6 x3 +1/120 x5 -1/5040 x7 +1/362880 x9 + ...
Line 237 ⟶ 238:
C*C + S*S : 1
1 + T*T - T' : 0
SIN (reset) : NaRAT x + ...
SIN : x -1/6 x3 +1/120 x5 -1/5040 x7 +1/362880 x9 + ...
COS : 1 -1/2 x2 +1/24 x4 -1/720 x6 +1/40320 x8 -1/3628800 x10 + ...
|