Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"math"
)
// Don't use float32
// float64 precision is required for this to work correctly
func PMT(p, r, n float64) float64 {