/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/math-extras/__tests__/floatEqual.test.ts
14 строк
437 B
Matt Karl
chore: Reorganize tests into more conventional structure (#11126)
04 дек 2024, 23:36
Не верифицирован
04 дек 2024, 23:36
a68e311
Код
Авторство
О чём код?
import { floatEqual } from '../util'; describe('floatEqual', () => { it('should return true if the difference between values is less than epsilon', () => { // 0.1 + 0.2 = 0.3 is the common floating point pitfall. expect(floatEqual(0.1 + 0.2, 0.3)).toEqual(true); // now let's make it false expect(floatEqual(0.1 + 0.2 + 0.00001, 0.3)).toEqual(false); }); });