more robust scalar comparison: use `bc`
issue #28: add unit test