• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbarbin / fingerboard / 136

16 Mar 2026 03:55PM UTC coverage: 92.138% (+0.004%) from 92.134%
136

push

github

mbarbin
Merge branch 'flatten-stdlib'

58 of 65 new or added lines in 9 files covered. (89.23%)

3832 of 4159 relevant lines covered (92.14%)

20256.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.82
/src/stdlib/float0.ml
1
(**********************************************************************************)
2
(*  Fingerboard - a microtonal geography of the cello fingerboard                 *)
3
(*  Copyright (C) 2022-2024 Mathieu Barbin <mathieu.barbin@gmail.com>             *)
4
(*                                                                                *)
5
(*  This file is part of Fingerboard.                                             *)
6
(*                                                                                *)
7
(*  Fingerboard is free software: you can redistribute it and/or modify it under  *)
8
(*  the terms of the GNU Affero General Public License as published by the Free   *)
9
(*  Software Foundation, either version 3 of the License, or any later version.   *)
10
(*                                                                                *)
11
(*  Fingerboard is distributed in the hope that it will be useful, but WITHOUT    *)
12
(*  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or         *)
13
(*  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License   *)
14
(*  for more details.                                                             *)
15
(*                                                                                *)
16
(*  You should have received a copy of the GNU Affero General Public License      *)
17
(*  along with Fingerboard. If not, see <https://www.gnu.org/licenses/>.          *)
18
(**********************************************************************************)
19

20
include Stdlib.Float
21

22
let compare a b = Ordering.of_int (Float.compare a b)
368,822✔
23

24
let iround_nearest_exn f =
25
  let i = Int.of_float f in
17,068✔
26
  if i >= 0
17,068✔
27
  then (
17,066✔
28
    match compare (f -. Int.to_float i) 0.5 with
17,066✔
29
    | Gt -> i + 1
7,855✔
NEW
30
    | Eq | Lt -> i)
×
31
  else (
2✔
32
    match compare (Int.to_float i -. f) 0.5 with
2✔
33
    | Gt -> i - 1
1✔
NEW
34
    | Eq | Lt -> i)
×
35
;;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc