.. # split from OESystemFunctions.rst:2710

.. include:: ../substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OETanimoto

.. oe:function:: OETanimoto

   .. oe:language:: c++ java csharp

      .. oe:api::

         double OETanimoto(const OEBitVector& a, const OEBitVector& b)

   .. oe:language:: python

      .. oe:api:: python

         OETanimoto(a: OEBitVector, b: OEBitVector) -> float

   Calculates the ``Tanimoto similarity coefficient`` between two
   :oe:cls:`OEBitVectors<OESystem::OEBitVector>`.
   This is defined as the
   number of bits that the two bitmaps/fingerprints have in common
   divided by the total of bits set in either. This function does not
   require that the two :oe:cls:`OEBitVectors<OESystem::OEBitVector>`
   be the same size, the bits
   lacking from the shorter :ref:`OEBitVector <OESystem_OEBitVector>` being interpreted as all
   zeros. This function always returns ``1.0``, if the two
   :oe:cls:`OEBitVectors<OESystem::OEBitVector>`
   are equal, even if they are both empty.


