Ticket #627: 0003-log-is-ambigous-to-float-and-double.patch

File 0003-log-is-ambigous-to-float-and-double.patch, 697 bytes (added by Dagobert Michelsen, 11 years ago)

Make type explicit when calling log

  • weight/tfidfweight.cc

    From bdf4d8e5b1d788ab2ebc4f736ea0c2d837a8dfd0 Mon Sep 17 00:00:00 2001
    From: Dagobert Michelsen <dam@opencsw.org>
    Date: Fri, 20 Sep 2013 21:47:43 +0200
    Subject: [PATCH] log() is ambigous to float and double
    
    ---
     weight/tfidfweight.cc | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/weight/tfidfweight.cc b/weight/tfidfweight.cc
    index e02ed88..355d438 100644
    a b TfIdfWeight::get_wdfn(Xapian::termcount wdf, char c) const  
    123123            return (wdf * wdf);
    124124        case 'l':
    125125            if (wdf == 0) return 0;
    126             return (1 + log(wdf));
     126            return (1 + log((double)wdf));
    127127        default:
    128128            return wdf;
    129129    }