Does Javascript handle integer overflow and underflow? If yes, how?
问题 We know that Java does not handle underflows and overflows, but how does Javascript handle these for integers? Does it go back to a minimum/maximum? If yes, which minimum/maximum? I need to split a string and compute a hash value based on its characters. 回答1: In a simple test, when I try this: var max = Number.MAX_VALUE; var x = max + 10; var min = Number.MIN_VALUE; var y = min / 10; I find that x and max have the same value (in Chrome, IE and Firefox) so it appears that some overflows are