3 ms·
The original price candidate, derived from the logarithm, that is second closest to integer cents is 62.91998, with 162.85966 coming in 6th and the other positi
by sesqu 16y ago
The original price candidate, derived from the logarithm, that is second closest to integer cents is 62.91998, with 162.85966 coming in 6th and the other positions filled by implausibly large numbers.
Neither number has integer cents, since the actual series rounded or truncated values between iterations. For that reason, a simple logarithm won't tell us what the original price was - you'd need a simulation of the rounding.
- AretNCarlsen 16y agoGood idea! Here it is in C: http://pastie.org/1824968 http://pastie.org/1824968 (You have to manually add the 'f' after the constants if you want to do the whole thing in floating-point, as well as uncommenting the correct Dollars_t definition.) For the range $20.00 to $200.00, no exact matches to an integer original price (in cents) for the algorithms ceiling, floor, or round, in float or double. This was on a 32-bit Xeon server (EC2).