Changeset 27ed546 for python/tests


Ignore:
Timestamp:
Oct 30, 2018, 10:15:10 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
cefa29d
Parents:
5ce504d
Message:

[py] [test] expect a small rounding error when using double precision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_note2midi.py

    r5ce504d r27ed546  
    44from __future__ import unicode_literals
    55
    6 from aubio import note2midi, freq2note, note2freq
     6from aubio import note2midi, freq2note, note2freq, float_type
    77from nose2.tools import params
    88import unittest
     
    128128    def test_note2freq_under(self):
    129129        " make sure note2freq(A4) == 440"
    130         self.assertEqual(440, note2freq("A4"))
     130        if float_type == 'float32':
     131            self.assertEqual(440, note2freq("A4"))
     132        else:
     133            self.assertLess(abs(note2freq("A4")-440), 1.e-12)
    131134
    132135if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.