O'Reilly logo

Programming with JavaScript: Algorithms and Applications for Desktop and Mobile Browsers by Dionisio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX B

Numeric Encoding

Introduction

This appendix explains various ways in which numbers can be represented and encoded in computer systems in general, and JavaScript in particular. It covers binary, decimal, and hexadecimal numerals, the representation of noninteger values, and the details behind JavaScript’s belief that 0.1 + 0.2 ≠ 0.3.

Place Value

A number is an abstraction of a quantity; a numeral is a representation of a number. For example, the number seventy-six can be denoted by the Roman numeral LXXVI, the Hindu-Arabic decimal numeral 76, the Hindu-Arabic hexadecimal numeral 4C, or the Hindu-Arabic binary numeral 1001100.

Hindu-Arabic systems represent numerals as a sequence of digits with an optional radix point. The number of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required