use float64
This commit is contained in:
@@ -84,9 +84,9 @@ func (p Bitmap) SetFreeN(number int) error {
|
||||
return fmt.Errorf("set free pixel: no such number=%d, max=%d", number, n)
|
||||
}
|
||||
|
||||
func (p Bitmap) Circle(x, y int, r float32, fill bool) {
|
||||
func (p Bitmap) Circle(x, y int, r float64, fill bool) {
|
||||
plotX := 0
|
||||
plotY := int(math.Ceil(float64(r)))
|
||||
plotY := int(math.Ceil(r))
|
||||
delta := 3 - 2*plotY
|
||||
lastY := plotY
|
||||
for plotX <= plotY {
|
||||
|
||||
@@ -221,7 +221,7 @@ func TestClear(t *testing.T) {
|
||||
func TestCircle(t *testing.T) {
|
||||
type testCase struct {
|
||||
x, y int
|
||||
r float32
|
||||
r float64
|
||||
filled bool
|
||||
}
|
||||
for i, tc := range []testCase{
|
||||
|
||||
Reference in New Issue
Block a user