Search the Community
Showing results for tags 'arithmetic invalid values nan'.
For the Chapter 4 shopping example, on p.107: I've got it working when I enter valid numbers, just as in Figure 4.4, but when I enter the string 'cat' in the Quantity field, as you do in Figure 4.5, I get -3.00 in the Total field, not NaN as shown in the book. I realize that the eventual answer is going to be to validate all input before doing any calculations, but I'd still like to know what's going on here, and why my results are not agreeing with the book. Thanks.