/    Sign up×
Community /Pin to ProfileBookmark

handling large numbers javascript

Hi all,

I am stuck in handling very large numbers in Javascript. Numbers that are greater than 2147483648 ( I think this is the int limit ). Does Javascript accept unsigned long data types (or) is there some other way to handle this?. I am trying to do a bitwise OR of this large number. Bitwise OR with any other number returns me a negative result. Can any one help me out. Any help would be appreciated.

Thanks in Advance.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@PittimannMar 08.2004 — Hi!

In what context do you have the problem?

Does this work for you:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Untitled</title>

<script language="JavaScript" type="text/javascript">

<!--

var x=2147483648000000;

alert(x+'n'+parseInt(x*2));

//-->

</script>

</head>

<body>

</body>

</html>

??

Cheers - Pit
Copy linkTweet thisAlerts:
@AdamGundryMar 08.2004 — The JavaScript Number class has a property MAX_VALUE which gives the largest number it can hold. On my system it is 1.7976931348623157e+308, which should be large enough for just about anything.

Adam
×

Success!

Help @srivats123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...