sum and fsum
This commit is contained in:
parent
b7628eb336
commit
4394399bc7
|
@ -41,7 +41,7 @@ let width_of_text font text =
|
|||
match font with
|
||||
| Pdftext.SimpleFont {Pdftext.fontmetrics = Some fontmetrics} ->
|
||||
begin try
|
||||
fold_left ( +. ) 0. (map (fun c -> fontmetrics.(int_of_char c)) (explode text))
|
||||
fsum (map (fun c -> fontmetrics.(int_of_char c)) (explode text))
|
||||
with
|
||||
_ -> 0.
|
||||
end
|
||||
|
|
|
@ -35,7 +35,7 @@ let read_chunk i =
|
|||
(string_of_tag chunktype, chunkdata)
|
||||
|
||||
let concat_bytes ss =
|
||||
let total_length = fold_left ( + ) 0 (map bytes_size ss) in
|
||||
let total_length = sum (map bytes_size ss) in
|
||||
let s' = mkbytes total_length in
|
||||
let p = ref 0 in
|
||||
iter
|
||||
|
|
Loading…
Reference in New Issue