dosyago / floppsy

:baby_chick: floppsy - SMHasher-passing 200Mb/s hash using floating-point ops
https://88e9g.csb.app/
MIT License
12 stars 3 forks source link

cpp implementation produces different results #4

Closed o0101 closed 7 years ago

o0101 commented 7 years ago

We need to work out if the c++ implementation and the es implementation can produce the same results ( and how to get them to ), or if they cannot ( because of, say, differences in floating point arithmetic.

this is coming from tests using SMHasher ( specifically the verification test ).

Calculating the verification test value in JS gives me 39B945E5

While in the C++ version I get BB168BEF

A relevant SO question: https://stackoverflow.com/questions/44480529/is-double-arithmetic-the-same-in-cpp-and-javascript?noredirect=1#comment75955733_44480529

o0101 commented 7 years ago

This is a feature not a bug. Floating point is inconsistent across targets. Deal with it. Shall not fix.