mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 07:29:47 +08:00
14 lines
465 B
JavaScript
14 lines
465 B
JavaScript
import { fareyApproximation } from '../FareyApproximation'
|
|
|
|
describe('fareyApproximation', () => {
|
|
it('Return Farey Approximation of 0.7538385', () => {
|
|
const approx = fareyApproximation(0.7538385)
|
|
expect(approx).toStrictEqual({ numerator: 52, denominator: 69 })
|
|
})
|
|
|
|
it('Return Farey Approximation of 0.23584936', () => {
|
|
const approx = fareyApproximation(0.23584936)
|
|
expect(approx).toStrictEqual({ numerator: 196, denominator: 831 })
|
|
})
|
|
})
|