級数の発散を体験
1 + 1/2 + 1/3 + ... などを計算してみる
code:javascript
var text = $('<span>');
text.css('position','absolute');
text.css('left',20).css('top',20).attr('width',400).attr('height',400).css('z-index','100');
text.css('background-color','#eee');
$('body').append(text);
val = 0;
i = 1;
function disp(){
val = val + 1.0 / i;
text.text(val);
i += 1;
}
setInterval(disp,10);