floatToInt.go
floatToInt.go - Overview
This file provides a utility function to check if a float64 value can be safely converted to an integer without loss of precision.
Detailed Documentation
Function: IsFloatToIntPossible
- Purpose: Checks if a
float64
value can be converted to anint
without losing precision. - Parameters:
value
(float64
): The floating-point number to check.
- Returns:
(int, bool)
: Returns the integer value andtrue
if the conversion is possible without loss of precision. Otherwise, returns0
andfalse
.