Checking if a value is within a time range How can I improve the style to avoid so many float64()s?

func IsInTimeRange(tvalue int32,timeout int){
    t := time.Now().Unix()
    return int(math.Abs(float64(t)-float64(tvalue))) &lt; timeout
}
For example,

package main

import (
    "fmt"
    "time"
)

func IsInTimeRange(tvalue int32, timeout int) bool {
    delta := int(time.Now().Unix() - int64(tvalue))
    return -timeout &lt; delta &amp;&amp; delta &lt; timeout
}

func main() {}


tvalue int32 will overflow in year 2038, change it to tvalue int64.

package main

import "time"

func IsInTimeRange(tvalue int64, timeout int) bool {
    delta := int(time.Now().Unix() - tvalue)
    return -timeout &lt; delta &amp;&amp; delta &lt; timeout
}

func main() {}