SIGN IN SIGN UP

Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.

34084 0 0 JavaScript
2021-07-19 13:17:06 +05:30
import { fareyApproximation } from '../FareyApproximation'
2021-07-19 13:12:47 +05:30
describe('fareyApproximation', () => {
it('Return Farey Approximation of 0.7538385', () => {
const approx = fareyApproximation(0.7538385)
2021-07-19 13:25:00 +05:30
expect(approx).toStrictEqual({ numerator: 52, denominator: 69 })
2021-07-19 13:12:47 +05:30
})
2021-07-19 13:17:06 +05:30
2021-07-19 13:12:47 +05:30
it('Return Farey Approximation of 0.23584936', () => {
const approx = fareyApproximation(0.23584936)
2021-07-19 13:25:00 +05:30
expect(approx).toStrictEqual({ numerator: 196, denominator: 831 })
2021-07-19 13:12:47 +05:30
})
})