문제

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