As others have already pointed out, the F # compiler does not automatically insert any conversions between numeric types. This means that if you write a function that works with float, you need to pass it a float as arguments.
, Math.Sqrt . , , ( Math.Sqrt ):
> let side (x1,y1) (x2,y2) =
Math.Sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));;
val side : float * float -> float * float -> float
floats , , . , , . :
> let side (x1:int16,y1) (x2,y2) =
let n = (x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)
Math.Sqrt(float(n));;
val side : int16 * int16 -> int16 * int16 -> float
( , y1, x2,... int16, / ). , :
side ( 2s, 3s ) ( 1s, 2s )
, desco - ββ ( float), - , int, , , side (2,3) (1,2).