2
votes

I'm writing some simple operations on floating-point numbers. But when I use some of the built-in float functions like

floor 3.2;;

I get this error:

This expression has type float but an expression was expected of type
         [ `Deprecated_use__Float__round_down ]

What is going wrong here?

I'm on version 4.02.1

1

1 Answers

7
votes

This is a Core "replacement" for the stdlib function floor. Opening Core shadows the usual floor with a function that has a cute type that that is meant to suggest that the user should pick another function.

You can either follow the suggestion and use Float.round_down or get your hands on the original binding and use that.