scilab/scilab-6.1.0-ocaml.patch

31 lines
893 B
Diff
Raw Normal View History

--- a/modules/scicos/src/modelica_compiler/optimization.ml
+++ b/modules/scicos/src/modelica_compiler/optimization.ml
@@ -20,6 +20,7 @@
*
*)
+open Num
open SymbolicExpression
@@ -162,8 +163,7 @@ let num_of_float f =
let num_of_positive_float f =
let m, e = frexp f in
let sm = string_of_float m in
- let s = String.make 16 '0' in
- String.blit sm 2 s 0 (String.length sm - 2);
+ let s = String.sub sm 2 (String.length sm - 2) in
let e' = Num.power_num (Num.Int 2) (Num.num_of_int e) in
Num.div_num (Num.mult_num (Num.num_of_string s) e') scaling_factor
in
--- a/modules/scicos/src/modelica_compiler/xMLCodeGeneration.ml
+++ b/modules/scicos/src/modelica_compiler/xMLCodeGeneration.ml
@@ -20,6 +20,7 @@
*
*)
+open Num
type 'a tree = Leaf of (string * 'a) | Node of string * 'a tree list
(* function used to hide XML special characters *)