Lottery/Combinations

new topic     » goto parent     » topic index » view thread      » older message » newer message

-P45311@NF

Hello Euphorians,

I just found a flaw in my function:

LH>    c *= (length(set)-x) / x

There could be rounding errors, because the division is done before the 
multiplication. This is better:

c = c * (length(set)-x) / x

Doesn't look much different, but here the multiplication is done first, and 
the division will always result in an integer.

Lutz.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu