Skip to content

Commit

Permalink
Only use JERRY_NUMBER_TYPE_FLOAT64 == 0 for calculating, not for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
lygstate committed Dec 11, 2024
1 parent c64e3c1 commit 84f9595
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions jerry-core/ecma/base/ecma-globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,49 +229,15 @@ enum
#endif /* JERRY_BUILTIN_GLOBAL_THIS */
};

#if !JERRY_NUMBER_TYPE_FLOAT64
/**
* Maximum integer number for an ecma value
*/
#define ECMA_INTEGER_NUMBER_MAX 0x7fffff
/**
* Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
*/
#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7fffff0
#else /* JERRY_NUMBER_TYPE_FLOAT64 */
/**
* Maximum integer number for an ecma value
*/
#define ECMA_INTEGER_NUMBER_MAX 0x7ffffff
/**
* Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
*/
#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7ffffff0
#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */
#define ECMA_INTEGER_NUMBER_MAX 0x3FFFFFFF

#if !JERRY_NUMBER_TYPE_FLOAT64
/**
* Minimum integer number for an ecma value
*/
#define ECMA_INTEGER_NUMBER_MIN -0x7fffff
/**
* Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
*/
#define ECMA_INTEGER_NUMBER_MIN_SHIFTED -0x7fffff0
#else /* JERRY_NUMBER_TYPE_FLOAT64 */
/**
* Minimum integer number for an ecma value
*/
#define ECMA_INTEGER_NUMBER_MIN -0x8000000
/**
* Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT)
*/
#define ECMA_INTEGER_NUMBER_MIN_SHIFTED (-0x7fffffff - 1) /* -0x80000000 */
#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */

#if ECMA_DIRECT_SHIFT != 4
#error "Please update ECMA_INTEGER_NUMBER_MIN/MAX_SHIFTED according to the new value of ECMA_DIRECT_SHIFT."
#endif /* ECMA_DIRECT_SHIFT != 4 */
#define ECMA_INTEGER_NUMBER_MIN -0x40000000

/**
* Checks whether the integer number is in the integer number range.
Expand Down

0 comments on commit 84f9595

Please sign in to comment.