use strict; use warnings; use Quantum::Superpositions; print(Quantum::Superpositions->VERSION(), "\n"); if (all(1,2,3)*any(5,6) < 21) { print "no alcohol\n"; } if (all(1,2,3)*any(5,6) < 18) { print "no entry\n"; } if (any(1,2,3)*all(5,6) < 18) { print "under-age\n" } print(all(1,2,3)*any(5,6), "\n"); print(all(1,2,3)*any(5,6), "\n"); print(any(1,2,3)*all(5,6), "\n");
I get:
2.02 no alcohol no entry all(any(6,5),any(10,12),any(18,15)) all(any(6,5),any(10,12),any(18,15)) any()
The documentation says I should get:
2.02 no alcohol under-age all(5,6,10,12,15,18) all(5,6,10,12,15,18) any(5,6,10,12,15,18)
The bug might have been introduced by this change in 2.00:
Replaced the cross product with an iterator. this means that any(@these) != all(@those) does not need to generate the full cartesian product up front. The prime sieve (demo/demo_Primes) now runs in reasonable time/memory.
In reply to Re: Quantum::Superpositions problem
by ikegami
in thread Quantum::Superpositions problem
by orange
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |