Skip to content

Commit

Permalink
link to org.javarosa.core.model.ItemsetBinding.resolveRandomSeed() so…
Browse files Browse the repository at this point in the history
…urcecode
  • Loading branch information
brontolosone committed Dec 10, 2024
1 parent 159f06c commit bf0008c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/xpath/src/lib/collections/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const seededRandomize = <T>(values: readonly T[], seed?: number): T[] =>
let finalSeed: number;
// Per issue #49 this is (to an extent) "bug-or-feature-compatible" with JavaRosa's implementation.
// org.javarosa.core.model.ItemsetBinding.resolveRandomSeed takes the .longValue() of
// the double produced by randomSeedPathExpr.eval().
// the double produced by randomSeedPathExpr.eval() — see https://github.com/getodk/javarosa/blob/6ce13527c/src/main/java/org/javarosa/core/model/ItemsetBinding.java#L311:L317 .
// That results in a 0L when the double is NaN, which happens (for instance) when there
// is a string that does not look like a number (which is a problem in itself, as any non-numeric
// looking string will then result in the same seed of 0 — see https://github.com/getodk/javarosa/issues/800).
Expand Down

0 comments on commit bf0008c

Please sign in to comment.