majensen / perlbolt

Neo4j server agent using Bolt protocol
Apache License 2.0
4 stars 2 forks source link

roundtrip test fails with -Duselongdouble #31

Closed eserte closed 4 years ago

eserte commented 4 years ago

If perl was compiled with -Duserlongdouble then the test suite fails:

#   Failed test 'roundtrip'
#   at t/002_types.t line 12.
#          got: '100.099999999999994'
#     expected: '100.1'
Not yet implemented# Looks like you failed 1 test of 26.
t/002_types.t ......... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/26 subtests 
johannessen commented 4 years ago

Thanks for reporting this!

Unfortunately, the Bolt protocol is limited to 64-bit doubles, so the underlying issue can’t be fixed. All we can do is to mask the issue by replacing 100.1 with a number that can be represented exactly in binary floating point.