#include <wchar.h>
#endif
+#include <math.h>
#include <unistr.h>
#include "libguile/_scm.h"
case scm_tc16_real:
{
double r = SCM_REAL_VALUE (obj);
- if (floor (r) == r)
+ if (floor (r) == r && !isinf (r) && !isnan (r))
{
obj = scm_inexact_to_exact (obj);
return scm_to_ulong (scm_modulo (obj, scm_from_ulong (n)));
;;;; hash.test --- test guile hashing -*- scheme -*-
;;;;
-;;;; Copyright (C) 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+;;;; Copyright (C) 2004, 2005, 2006, 2008, 2011 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
(hash #t 0))
(pass-if (= 0 (hash #t 1)))
(pass-if (= 0 (hash #f 1)))
- (pass-if (= 0 (hash noop 1))))
+ (pass-if (= 0 (hash noop 1)))
+ (pass-if (= 0 (hash +inf.0 1)))
+ (pass-if (= 0 (hash -inf.0 1)))
+ (pass-if (= 0 (hash +nan.0 1))))
;;;
;;; hashv