mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
parent
972a6f2720
commit
55e92b4629
3 changed files with 30 additions and 2 deletions
|
|
@ -696,7 +696,7 @@ let prefix ~pre s =
|
||||||
else (
|
else (
|
||||||
let rec check i =
|
let rec check i =
|
||||||
if i=len then true
|
if i=len then true
|
||||||
else if String.unsafe_get s i != String.unsafe_get pre i then false
|
else if not (Char.equal (String.unsafe_get s i) (String.unsafe_get pre i)) then false
|
||||||
else check (i+1)
|
else check (i+1)
|
||||||
in
|
in
|
||||||
check 0
|
check 0
|
||||||
|
|
@ -719,7 +719,7 @@ let suffix ~suf s =
|
||||||
let off = String.length s - len in
|
let off = String.length s - len in
|
||||||
let rec check i =
|
let rec check i =
|
||||||
if i=len then true
|
if i=len then true
|
||||||
else if String.unsafe_get s (off+i) != String.unsafe_get suf i then false
|
else if not (Char.equal (String.unsafe_get s (off+i)) (String.unsafe_get suf i)) then false
|
||||||
else check (i+1)
|
else check (i+1)
|
||||||
in
|
in
|
||||||
check 0
|
check 0
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,12 @@
|
||||||
|
|
||||||
include Pervasives
|
include Pervasives
|
||||||
|
|
||||||
|
let (=.) : float -> float -> bool = (=)
|
||||||
|
let (<>.) : float -> float -> bool = (<>)
|
||||||
|
let (<.) : float -> float -> bool = (<)
|
||||||
|
let (>.) : float -> float -> bool = (>)
|
||||||
|
let (<=.) : float -> float -> bool = (<=)
|
||||||
|
let (>=.) : float -> float -> bool = (>=)
|
||||||
|
|
||||||
let (==) = `Consider_using_CCEqual_physical
|
let (==) = `Consider_using_CCEqual_physical
|
||||||
|
let (!=) = `Consider_using_CCEqual_physical
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,25 @@ val compare : int -> int -> int
|
||||||
val min : int -> int -> int
|
val min : int -> int -> int
|
||||||
val max : int -> int -> int
|
val max : int -> int -> int
|
||||||
|
|
||||||
|
(** {2 Infix operators for Floats} *)
|
||||||
|
|
||||||
|
val (=.) : float -> float -> bool (** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val (<>.) : float -> float -> bool (** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val (<.) : float -> float -> bool (** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val (>.) : float -> float -> bool (** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val (<=.) : float -> float -> bool (** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val (>=.) : float -> float -> bool (** @since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
(** {2 Shadow Dangerous Operators} *)
|
||||||
|
|
||||||
val (==) : [`Consider_using_CCEqual_physical]
|
val (==) : [`Consider_using_CCEqual_physical]
|
||||||
[@@ocaml.deprecated "Please use CCEqual.physical or Pervasives.(==) instead."]
|
[@@ocaml.deprecated "Please use CCEqual.physical or Pervasives.(==) instead."]
|
||||||
|
|
||||||
|
(** @since NEXT_RELEASE *)
|
||||||
|
val (!=) : [`Consider_using_CCEqual_physical]
|
||||||
|
[@@ocaml.deprecated "Please use [not CCEqual.physical] or Pervasives.(!=) instead."]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue