floatToNanos converts a fractional number representing nanoseconds to the number of integer nanoseconds. For example: ".354874219" to "354874219" or ".123" to "123000000". This function takes care to round correctly when a naive conversion would incorrectly truncate due to floating point inaccuracie
(f float64)
| 664 | // https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/timestamp.c;h=449164ae7e5b00f6580771017888d4922685a73c;hb=HEAD#l1511 |
| 665 | // https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/port/rint.c;h=d59d9ab774307b7db2f7cb2347815a30da563fc5;hb=HEAD |
| 666 | func floatToNanos(f float64) int64 { |
| 667 | return int64(math.Round(f * float64(time.Second.Nanoseconds()))) |
| 668 | } |
no test coverage detected
searching dependent graphs…