From: Tammo Freese Date: 2001-03-06T19:36:59+09:00 Subject: [ruby-talk:12112] NaN, Infinity (Bug?) After the Pickaxe Book, first print, p. 320 a = -1.0 -> -1.0 a.nan? -> false a = Math.log(a) -> NaN a.nan? -> true But testing (ruby 1.6.2 (2000-12-18) [i386-cygwin]) # a = -1.0 puts a puts a.nan? a = Math.log(-1.0) puts a puts a.nan? # gives -1.0 false -Infinity false This issue was already raised in ruby-talk #5085 by Mathieu Bouchard. However, as the results of the code in the pickaxe book are generated by running the code (aren't they?), 1.6.0 seems to have the correct(?) behaviour (returning NaN). Is this a defect or an error in the pickaxe book? - Tammo Freese freese@acm.org