projects
/
Faustine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add logical shift left (<<) and logical shift right (>>) to faustine.
[Faustine.git]
/
interpretor
/
aux.ml
diff --git
a/interpretor/aux.ml
b/interpretor/aux.ml
index
a33e722
..
7c21a61
100644
(file)
--- a/
interpretor/aux.ml
+++ b/
interpretor/aux.ml
@@
-27,3
+27,10
@@
let rint : float -> float =
fun f ->
if (f -. (floor f)) >= 0.5 then ceil f
else floor f;;
fun f ->
if (f -. (floor f)) >= 0.5 then ceil f
else floor f;;
+
+let remainder_float : float -> float -> float =
+ fun f1 -> fun f2 ->
+ let r = mod_float f1 f2 in
+ if (abs_float r) > ((abs_float f2) /. 2.) then
+ (if r *. f2 > 0. then (r -. f2) else (r +. f2))
+ else r;;