mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-18 01:05:42 +08:00
14 lines
445 B
JavaScript
14 lines
445 B
JavaScript
import { fareyApproximation } from '../FareyApproximation'
|
|
|
|
describe('fareyApproximation', () => {
|
|
it('Return Farey Approximation of 0.7538385', () => {
|
|
const approx = fareyApproximation(0.7538385)
|
|
expect(approx).toBe({ numerator: 22, denominator: 29 })
|
|
})
|
|
|
|
it('Return Farey Approximation of 0.23584936', () => {
|
|
const approx = fareyApproximation(0.23584936)
|
|
expect(approx).toBe({ numerator: 13, denominator: 55 })
|
|
})
|
|
})
|