forked from: 念のため計算機イプシロンを算出してみる:Re
forked from 念のため計算機イプシロンを算出してみる:Re (diff: 42)
前にもあった気がしたんで、参考に作ってみました。 AS3.0さわるの実質初めてです…よくわからんかった…
ActionScript3 source code
/**
* Copyright Nos_lkSsvOhB ( http://wonderfl.net/user/Nos_lkSsvOhB )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/chmT
*/
// forked from Nosuke_lkSsvOhB's 念のため計算機イプシロンを算出してみる:Re
package {
import flash.display.Sprite;
import flash.text.TextField;
public class main extends Sprite {
public function main(){
var _text:TextField = new TextField();
_text.x=30;
_text.y=60;
addChild(_text);
var _text2:TextField = new TextField();
_text2.x=30;
_text2.y=80;
addChild(_text2);
var _text3:TextField = new TextField();
_text3.width=400;
_text3.height=18;
_text3.x=30;
_text3.y=100;
addChild(_text3);
var _text4:TextField = new TextField();
_text4.x=30;
_text4.y=120;
_text4.width=400;
_text4.height=18;
addChild(_text4);
var i : Number = 0;
_text.text="stage.width=" + stage.stageWidth;
_text2.text="stage.height=" + stage.stageHeight;
while(1){
var g : * = Math.pow(10,-i);
if(1.0+g==1.0){
_text3.text="10^-" + i + "=" + g;
_text4.text = "EPS=" + g;
i=0;
break;
}
i++;
}
}
}
}
