質問

Kinda stupid question but I can't get this to compile in JavaScript:

var float_MaxValue = 3.40282347e+38F; // largest positive number in float32
var float_MinValue = -3.40282347e+38F; // largest negative number in float32
var float_Eplison = 1.175494351e-38F; // smallest number in float32

How do I convert the literals into decimal/hex syntax or whatever compiles? Do you know how to get this to compile?

役に立ちましたか?

解決

Try it without the "F" at the end

var float_MaxValue = 3.40282347e+38; // largest positive number in float32
var float_MinValue = -3.40282347e+38; // largest negative number in float32
var float_Eplison = 1.175494351e-38; // smallest number in float32

Tried it in Chrome and it seems to work.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top