Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control.Lens.Setter (**~) doctest fails on some platforms #310

Closed
cjwatson opened this issue Jun 14, 2013 · 5 comments
Closed

Control.Lens.Setter (**~) doctest fails on some platforms #310

cjwatson opened this issue Jun 14, 2013 · 5 comments

Comments

@cjwatson
Copy link

On a couple of Debian architectures, one of the doctests for **~ fails due to a slight floating-point inequality, as follows:

https://buildd.debian.org/status/fetch.php?pkg=haskell-lens&arch=kfreebsd-i386&ver=3.9.0.2-2&stamp=1369593382
https://buildd.debian.org/status/fetch.php?pkg=haskell-lens&arch=hurd-i386&ver=3.9.0.2-2%2Bb1&stamp=1371039197

Failure in src/Control/Lens/Setter.hs:672: expression `_2 **~ pi $ (1,3)'

expected: (1,31.54428070019754)
but got: (1,31.544280700197532)

Would it be possible to either compare this to (1,3pi) directly, or else to tolerate some slight difference in the exact floating-point representation of 3pi? It doesn't look as though the precise representation is important to this test.

@ion1 ion1 closed this as completed in ab2c8ee Jun 17, 2013
@ion1
Copy link
Collaborator

ion1 commented Jun 17, 2013

I suppose that ought to work on all platforms.

@pthariensflame
Copy link
Collaborator

It actually only works on platforms whose fundamental number system is binary; there is at least one known system that uses balanced ternary instead. ;-)

@ion1
Copy link
Collaborator

ion1 commented Jun 17, 2013

:-) Feel free to reopen the bug when trying to build lens on one.

@cjwatson
Copy link
Author

Looks likely, indeed. Uploading to Debian shortly to make sure.

@cjwatson
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants