| Investments |
Investments The following tables summarize the Company’s investments (in thousands): | | | | | | | | | | | | | | | | | | February 3, 2018 | | Amortized Cost | | Gross Unrealized Gains | | Gross Unrealized Losses | | Estimated Fair Value | Short-term investments: | | | | | | | | Available-for-sale: | | | | | | | | U.S. government and agency debt | $ | 248,336 |
| | $ | 49 |
| | $ | (644 | ) | | $ | 247,741 |
| Foreign government and agency debt | 7,004 |
| | — |
| | (17 | ) | | 6,987 |
| Municipal debt securities | 2,734 |
| | — |
| | (6 | ) | | 2,728 |
| Corporate debt securities | 504,609 |
| | 469 |
| | (1,999 | ) | | 503,079 |
| Asset backed securities | 42,429 |
| | 3 |
| | (177 | ) | | 42,255 |
| Held-to-Maturity: | | | | | | | | Time deposits | 150,000 |
| | — |
| | — |
| | 150,000 |
| Total short-term investments | 955,112 |
| | 521 |
| | (2,843 | ) | | 952,790 |
| Total investments | $ | 955,112 |
| | $ | 521 |
| | $ | (2,843 | ) | | $ | 952,790 |
|
| | | | | | | | | | | | | | | | | | January 28, 2017 | | Amortized Cost | | Gross Unrealized Gains | | Gross Unrealized Losses | | Estimated Fair Value | Short-term investments: | | | | | | | | Available-for-sale: | | | | | | | | U.S. government and agency debt | $ | 185,584 |
| | $ | 86 |
| | $ | (283 | ) | | $ | 185,387 |
| Foreign government and agency debt | 13,425 |
| | — |
| | (50 | ) | | 13,375 |
| Municipal debt securities | 27,916 |
| | 4 |
| | (49 | ) | | 27,871 |
| Corporate debt securities | 432,603 |
| | 281 |
| | (776 | ) | | 432,108 |
| Asset backed securities | 45,541 |
| | 33 |
| | (47 | ) | | 45,527 |
| Held-to-Maturity: | | | | | | | | Time deposits | 150,000 |
| | — |
| | — |
| | 150,000 |
| Total short-term investments | 855,069 |
| | 404 |
| | (1,205 | ) | | 854,268 |
| Long-term investments: | | | | | | | | Available-for-sale: | | | | | | | | Auction rate securities | 4,615 |
| | — |
| | — |
| | 4,615 |
| Total long-term investments | 4,615 |
| | — |
| | — |
| | 4,615 |
| Total investments | $ | 859,684 |
| | $ | 404 |
| | $ | (1,205 | ) | | $ | 858,883 |
|
Short-term, highly liquid investments of $267.6 million and $162.1 million as of February 3, 2018 and January 28, 2017, respectively, included in cash and cash equivalents on the accompanying consolidated balance sheets are not included in the tables above because the gross unrealized gains and losses were immaterial as the carrying values approximate fair value because of the short term maturity of such investments. Gross realized gains and gross realized losses on sales of available-for-sale securities are presented in the following table (in thousands): | | | | | | | | | | | | | | Year Ended | | February 3, 2018 | | January 28, 2017 | | January 30, 2016 | Gross realized gains | $ | 186 |
| | $ | 2,047 |
| | $ | 1,654 |
| Gross realized losses | (2,963 | ) | | (547 | ) | | (1,923 | ) | Impairment loss | — |
| | — |
| | (1,204 | ) | Total net realized gains (losses) | $ | (2,777 | ) | | $ | 1,500 |
| | $ | (1,473 | ) |
The contractual maturities of available-for-sale securities are presented in the following table (in thousands): | | | | | | | | | | | | | | | | | | February 3, 2018 | | January 28, 2017 | | Amortized Cost | | Estimated Fair Value | | Amortized Cost | | Estimated Fair Value | Due in one year or less | $ | 554,247 |
| | $ | 553,866 |
| | $ | 423,151 |
| | $ | 423,058 |
| Due between one and five years | 400,866 |
| | 398,924 |
| | 423,669 |
| | 422,995 |
| Due over five years | — |
| | — |
| | 12,864 |
| | 12,830 |
| | $ | 955,113 |
| | $ | 952,790 |
| | $ | 859,684 |
| | $ | 858,883 |
|
For individual securities that have been in a continuous unrealized loss position, the fair value and gross unrealized loss for these securities aggregated by investment category and length of time in an unrealized position are presented in the following tables (in thousands): | | | | | | | | | | | | | | | | | | | | | | | | | | February 3, 2018 | | Less than 12 months | | 12 months or more | | Total | | Fair Value | | Unrealized Loss | | Fair Value | | Unrealized Loss | | Fair Value | | Unrealized Loss | U.S. government and agency debt | $ | 148,538 |
| | $ | (298 | ) | | $ | 51,332 |
| | $ | (346 | ) | | $ | 199,870 |
| | $ | (644 | ) | Foreign government and agency debt | 3,993 |
| | (1 | ) | | 2,994 |
| | (16 | ) | | 6,987 |
| | (17 | ) | Municipal debt securities | 1,969 |
| | (6 | ) | | — |
| | — |
| | 1,969 |
| | (6 | ) | Corporate debt securities | 253,380 |
| | (1,514 | ) | | 46,805 |
| | (485 | ) | | 300,185 |
| | (1,999 | ) | Asset backed securities | 37,636 |
| | (145 | ) | | 2,167 |
| | (32 | ) | | 39,803 |
| | (177 | ) | Total securities | $ | 445,516 |
| | $ | (1,964 | ) | | $ | 103,298 |
| | $ | (879 | ) | | $ | 548,814 |
| | $ | (2,843 | ) |
| | | | | | | | | | | | | | | | | | | | | | | | | | January 28, 2017 | | Less than 12 months | | 12 months or more | | Total | | Fair Value | | Unrealized Loss | | Fair Value | | Unrealized Loss | | Fair Value | | Unrealized Loss | U.S. government and agency debt | $ | 94,064 |
| | $ | (283 | ) | | $ | — |
| | $ | — |
| | $ | 94,064 |
| | $ | (283 | ) | Foreign government and agency debt | 11,875 |
| | (48 | ) | | 1,499 |
| | (2 | ) | | 13,374 |
| | (50 | ) | Municipal debt securities | 17,450 |
| | (47 | ) | | 1,248 |
| | (2 | ) | | 18,698 |
| | (49 | ) | Corporate debt securities | 199,382 |
| | (751 | ) | | 16,063 |
| | (25 | ) | | 215,445 |
| | (776 | ) | Asset backed securities | 16,754 |
| | (47 | ) | | — |
| | — |
| | 16,754 |
| | (47 | ) | Total securities | $ | 339,525 |
| | $ | (1,176 | ) | | $ | 18,810 |
| | $ | (29 | ) | | $ | 358,335 |
| | $ | (1,205 | ) |
|