nitlang / nit

Nit language
http://nitlanguage.org
Apache License 2.0
239 stars 65 forks source link

abstract_compiler: Replace the use of `n_float` by the `value` #2778

Closed Delja closed 5 years ago

Delja commented 5 years ago

Added methods

Add a little improvement of the abstract_compiler to generate a Float value by the usage of the value and not the n_float.

Add the float conversion in exponential hexadecimal notation.

    assert 12.345.to_hexa_exponential_notation    == "0x1.8b0a3d70a3d71p+3"
    assert 12.345.to_hexa_exponential_notation.to_f == 12.345

Future work

Take into account the scientific notation for the display.