Machine Constants in Javascript

D

david.binner

Hi, folks.

I am writing some numerical math programs in Javascript (translating
from C++) and am seeking your advice regarding machine constants.

C++ offers the <cfloat> library for accessing machine constants such
as DBL_MIN and DBL_EPSILON. Does Javascript offer comparable values?
If not, can you suggest a method (brute force or otherwise) for
calculating these values myself (in Javascript)?

Your assistance is appreciated.


David
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
glegroups.com>, Sat, 2 Jun 2007 14:33:51, (e-mail address removed)
posted:
I am writing some numerical math programs in Javascript (translating
from C++) and am seeking your advice regarding machine constants.

Before starting that task, you should have obtained, read, and
understood ISO/IEC 16262, and IEEE 754 or IEC 559. The answer would
then be obvious.

Logical arithmetic operations are 32-bit. Numbers are Doubles. Any
relevant machine-dependence is a Bug.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top