mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
Merge pull request #5 from hcengineering/fix-uptrace-nan
Fix Uptrace NaN error
This commit is contained in:
@@ -44,7 +44,10 @@ export function calcSørensenDiceCoefficient (a: string, b: string): number {
|
||||
}
|
||||
}
|
||||
|
||||
return (2.0 * intersectionSize) / (first.length + second.length - 2)
|
||||
const denominator = first.length + second.length - 2
|
||||
if (denominator <= 0) return 0
|
||||
|
||||
return (2.0 * intersectionSize) / denominator
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user