Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28760
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Comparisson operators |
| Date | 2015-09-29 12:24 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <87twqdcvt1.fsf@bsb.me.uk> (permalink) |
| References | <807dd61a-97ec-48cb-ad49-c6292a448a73@googlegroups.com> |
jonas.thornvall@gmail.com writes: > Does the comparisson operators also suffer from the 32/64 bit integer limit? > What happens if you assign a bigger value will it get truncated? You should start by understanding what the type Number is in ECMAScript. It is not an integer type in the usual sense of the word. It is a floating point type with very specific properties usually rather loosely called "IEEE floating point". It can, of course, store integer values, but your reference to a "32/64 bit integer limit" suggests you don't know what ECMAScript numbers are. > And what happen if you try to compare elements that is bigger than the > scope of javascript integers? A normal floating-point comparison is done, just as it always is. What matters is the range of integer values that can be represented exactly. That range is -(2**53 - 1) to 2**53 - 1. The latest ECMAScript defines property, Number.MAX_SAFE_INTEGER with the value 9007199254740991, but you can always calculate Math.pow(2, 53) - 1. -- Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Comparisson operators jonas.thornvall@gmail.com - 2015-09-28 23:24 -0700
Re: Comparisson operators "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-29 12:16 +0200
Re: Comparisson operators Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-29 12:24 +0100
Re: Comparisson operators Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-09-29 19:39 +0200
Re: Comparisson operators Silvio <silvio@internet.com> - 2015-09-30 13:28 +0200
csiph-web