head-first-csharp / fourth-edition

Code and graphics for the projects in the 4th edition of Head First C#
Other
889 stars 284 forks source link

Chapter 4, 4th edition method deprecation #19

Open chessboards opened 3 years ago

chessboards commented 3 years ago

The method used on page 160 for checking whether or not a float is infinite looks to have been replaced by float.IsInfinity(), at least in .NET version 5.0.300 image

Negating the result of IsInfinity() would fix the example of any errors

andrewstellman commented 3 years ago

Good catch—thanks! You're right, that bit of code was never changed from the 3rd edition of the book, before IsFinite was deprecated. I'll make sure future printings and digital editions are updated.