on master help sign in
Use toUpper to convert NaN and Infinity to C names

Convert NaN to NAN and Infinity to INFINITY, to use the names defined in math.h

commit3280526c179f8d8433366a385cf9e22e309f4952 authorEdmund Smith <edmund.pd.smith@gmail.com> dateSun 11 Jun 2017, 08:27 (9 years ago) parent59bfe8b
1 file changed+1−1
src/IRTS/CodegenC.hs+1−1
src/IRTS/CodegenC.hs+1−1
@@ -183,7 +183,7 @@ bcc i (ASSIGNCONST l c)
183183 mkConst (I i) = "MKINT(" ++ show i ++ ")"
184184 mkConst (BI i) | i < (2^30) = "MKINT(" ++ show i ++ ")"
185185 | otherwise = "MKBIGC(vm,\"" ++ show i ++ "\")"
186− mkConst (Fl f) = "MKFLOAT(vm, " ++ show f ++ ")"
186+ mkConst (Fl f) = "MKFLOAT(vm, " ++ (map toUpper $ show f) ++ ")"
187187 mkConst (Ch c) = "MKINT(" ++ show (fromEnum c) ++ ")"
188188 mkConst (Str s) = "MKSTR(vm, " ++ showCStr s ++ ")"
189189 mkConst (B8 x) = "idris_b8const(vm, " ++ show x ++ "U)"