Number.MAX_VALUE

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Number.MAX_VALUE

Dinko Pavicic
Hi all!
I'm trying to get equiv of Number.MAX_VALUE in flash.
The code I got ( I think from haxepunk if remember correctly ) is;

// Flash equivalent: Number.MAX_VALUE
#if flash
public inline static var NUMBER_MAX_VALUE = untyped __global__["Number"].MAX_VALUE;
#else
public inline static var NUMBER_MAX_VALUE = 179 * Math.pow(10, 306); // 1.79e+308
#end

but it always returns 0 ( I'm building a Flash target - Haxe 2.08 ).

Is there another method of getting the Number.MAX_VALUE?

Thanks in advance,
Dinko
Reply | Threaded
Open this post in threaded view
|

Re: Number.MAX_VALUE

Juraj Kirchheim
Can't you just use Math.POSITIVE_INFINITY or just a very big number
instead of the potentially biggest one.

On Tue, Nov 1, 2011 at 3:03 AM, Dinko Pavicic <[hidden email]> wrote:

> Hi all!
> I'm trying to get equiv of Number.MAX_VALUE in flash.
> The code I got ( I think from haxepunk if remember correctly ) is;
>
> // Flash equivalent: Number.MAX_VALUE
> #if flash
> public inline static var NUMBER_MAX_VALUE = untyped
> __global__["Number"].MAX_VALUE;
> #else
> public inline static var NUMBER_MAX_VALUE = 179 * Math.pow(10, 306); //
> 1.79e+308
> #end
>
> but it always returns 0 ( I'm building a Flash target - Haxe 2.08 ).
>
> Is there another method of getting the Number.MAX_VALUE?
>
> Thanks in advance,
> Dinko
>
>
> --
> View this message in context: http://haxe.1354130.n2.nabble.com/Number-MAX-VALUE-tp6950391p6950391.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Number.MAX_VALUE

Dinko Pavicic
Thanks, will try with that