From c91e1f1d4367b2880183ee55e1d5a1fc85411f56 Mon Sep 17 00:00:00 2001 From: Nikolai Kudasov Date: Mon, 9 Dec 2024 06:43:37 +0300 Subject: [PATCH] Handle negative zero for float --- eo-phi-normalizer/src/Language/EO/Phi/Syntax.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Syntax.hs b/eo-phi-normalizer/src/Language/EO/Phi/Syntax.hs index 2f7376c9a..22b48f2ad 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Syntax.hs +++ b/eo-phi-normalizer/src/Language/EO/Phi/Syntax.hs @@ -132,6 +132,7 @@ wrapBytesInConstInt bytes@(Bytes bs) wrapBytesInConstFloat :: Bytes -> Object wrapBytesInConstFloat bytes@(Bytes bs) + | x == 0 = [fmt|Φ.org.eolang.float(as-bytes ↦ 0.0)|] | x < 0 = [fmt|Φ.org.eolang.float(as-bytes ↦ Φ.org.eolang.bytes(Δ ⤍ {bs}))|] | otherwise = [fmt|Φ.org.eolang.float(as-bytes ↦ {x})|] where