Files
n8n-openai-adapter/lib/elixir
José Valim c19ed9f910 Introduce Float.ratio/1 and fix Float.{ceil/2, floor/2, round/2}
The previous implementations for ceil, floor and round were
not formalized and were likely prone to multiple roundings
as we performed multiplication and division by a power of
10 on the given float.

The new implementation correctly converts the float to an
exact integer representation and perform all operations using
arbitrary precision integers. The only float operation occurs
when converting the ratio back to a float.

The current implementation is more expensive due to its reliance
on big integers. Faster implementations are available in literature
where the latest one seems to be Errol:

  https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf

This change also introduces Float.ratio/1 which receives a
float and returns a pair of integers whose ratio is exactly equal
to the original float and with a positive denominator.

Closes #3400
2016-10-07 18:46:33 +02:00
..
2016-10-04 14:19:25 +02:00
2016-05-13 09:28:50 +02:00
2014-07-29 10:38:20 +02:00
2016-06-30 19:33:22 +02:00