Вопрос

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