contents   index   previous   next



FLOATING POINT CUSTOMIZATION

 

The ECMAScript standard specifies that an ECMAScript number match the double-precision 64-bit format IEEE 754 values. In most compilers this is represented as double, and this is the default for the ScriptEase engine. However, there may be situations where a different meaning for “number” may be more appropriate, such as when a double is too large or requires too much processing time (e.g., small systems without floating-point coprocessors), or when floating-point numbers are not needed at all.

 

Within the ScriptEase:ISDK/C the exact type for an ECMAScript number is never hard coded, but is instead defined by the senumber type. By default senumber is defined the same as the C double type, but that may be changed to any definition that is better suited to your system. The file src/include/sefp.h defines defaults for this value for floating-point and integer-only builds. You may choose to modify the type of senumber to be anything else, such as a float, an integer, a packed value, a string, or even a structure (as is found in the fpemul sample).


JSE_FLOATING_POINT (on)

JSE_FP_EMULATOR (off)