* Returns Int64 representing the given 32-bit integer value * @param {number} value 32-bit integer value * @returns {!Int64} The corresponding Int64 value
(value)
| 112 | * @returns {!Int64} The corresponding Int64 value |
| 113 | */ |
| 114 | static fromInt32 (value) { |
| 115 | value |= 0 |
| 116 | |
| 117 | let cache = ((value >= -128) && (value < 128)) |
| 118 | if (cache) { |
| 119 | let cached = Int64Cache[value] |
| 120 | if (cached) { |
| 121 | return cached |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | let result = Int64.fromBits(value, (value < 0) ? -1 : 0) |
| 126 | |
| 127 | if (cache) { |
| 128 | Int64Cache[value] = result |
| 129 | } |
| 130 | |
| 131 | return result |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Returns Int64 representing the given value, provided that it is a finite number. Otherwise, zero is returned. |
no test coverage detected