UncleMonster 发表于 2020-7-25 19:48:38

关于pow函数参数问题

当pow函数的第二个参数是0时,返回值是1还是0呢
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAACHCAYAAADNyUauAAAOp0lEQVR4Ae2dS5akKBRAXZcLcgu9DfeQg9qBw57nvGaxgh7kGujDz3wQ4J/ww61z6oSh+ISL3gBUslH8gwAEIFCIQFMoLmEhAAEIKATDSQABCBQjgGCKoSUwBCCAYDgHIACBYgTmBTN0qmka1favYpkgMAQg8EwCtxPMq2+N8JpueGaNUCoIPIjAvGAuU9hBdaYl1ZtPBHOZiiEjEMgSuI1ghq5RttFiRYNgsnXKBghchkBeMG7sRY+/6P/X6ZEgmMucPWQEAjME8oIZd7QX9DbBOBk4SXlZmc+2V9uGjRHMWDUsQODiBAoLpkTpEUwJqsSEQAkCCKYEVWJCAAKGQGHB0EXiPINAzQQKC6YEWrpIJagSEwIlCGQFo28LB4OyfqB222jv7ryPD9j5fPjPzYPFu7NEAAhAYIZAVjAz+7EZAhCAwCwBBDOLiAQQgMBWAghmKzn2gwAEZgkgmFlEJIAABLYSQDBbybEfBCAwSwDBzCIiAQQgsJUAgtlKjv0gAIFZAghmFhEJIACBrQQQzFZy7AcBCMwSqFMw0Vw3zDc8e56QAAKbCNQnGCOXVo1zmL961TKp+aaTh50gMEegMsG8VN++/4UE+55Tp5hGfO50YTsE1hGYFMxP/6X6phf/h2AWulfXq74L56UL1r2+1VczqG8fp/1WP8Pg4oWx1mV7Y2rTWhGtFx3GtWCaJlq/8RDsBgEI/BLIC8aIYFoCgUxczGCdEUyvei0Wuaxeamh6NSxuMhw0r0zUPbJvjLeqH2w36aQXxX9rgyUIPIzAjGCmJRDIxIEJ1hmpfKlv3chxgrFSWSuYg6h7wTihjH+ZwLViEMxBnAkDAUcgLxidwLc6XDfpq/8JwAUycVuCdVcTTK47lOo6BSXlCwQgsIXAtGBkRCcbKZlAJi5tsO4wwRzURVI2Tnxb2gzyMnGVrG2WIXAIgeWCUT/q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4rhf/kBUVsw+jm/ByBjhusz8OQsGa8M47ghz+7lWkM+fzBfL2wjcpwWjy+dbHW6uEjlRktmsJ0uK5i65vGCuWq5ADGtPLi0SpjhdS+2J6e8lGFkDTjZSMoFMXNpg3WEtmAO7SLJMevnUconM7BKMbXnUOcWpYMjijbpIb5X1/mcy7GDp73SPRi66teNbNYcJ5i0zB664SLl2CYYpTg88IW4d6jYtmPc7LfaPiIX07VjKeJepe9npHS8smKeWy9+NGccz/F2ecUV6OtPU2ImPFYwNiTjKyFAMuD9kitPw3L7nt9sI5p54yTUE6iaAYOquf0oPgaIEEExRvASHQN0EEEzd9U/pIVCUAIIpipfgEKibAIKpu/4pPQSKEkAwRfESHAJ1E0Awddc/pYdAUQL3E4x7YCt+zb4opangV8vPVF7ZBoEPE0Awe4FfTDDjU6/ySde9ZWR/CGwkcD/BbCzo83ezL2C2fa86Pb0Cgnl+ld+ghAjmKpV0wMuF1inuTW8Ec5WarTof9xGMf1lu7eRHpar36PzsFMxvMRHMLwuWziZwH8GMpOwFtO0H2l18TlLB27liDtfxUIsW9uRHHADBCBgsPoVAZYIpUW07BBNPMxCJb5dEt+1cAhAxKyaAYHZX/g7ByGPTgpE0WH4IgcoEQxfpIectxbgJgcoEU6JWaMGUoErMZxC4jWDMVIrRGIUZpD1prOFq+RkfsIsZbR68fsYJTinOJXAbwZyLiaNDAAJbCCCYLdTYBwIQWEQAwSzCRCIIQGALAQSzhRr7QAACiwggmEWYSAQBCGwh8D/IOAIzV31fcgAAAABJRU5ErkJggg==
图片中的 wheats = pow(2,i-1)这里的i初始化是1,-1后就是0了,pow(2,0)的返回值是1么,为什么呢{:10_266:}

Twilight6 发表于 2020-7-25 19:49:42


任何数的 0 次方 返回的都是 1

UncleMonster 发表于 2020-7-25 19:50:24

怎么图片莫名其妙显示了嘞

UncleMonster 发表于 2020-7-25 19:51:04

Twilight6 发表于 2020-7-25 19:49
任何数的 0 次方 返回的都是 1

感谢大佬,全面发两个帖子出问题了,发不出去{:10_250:}

zltzlt 发表于 2020-7-25 19:51:04

Twilight6 发表于 2020-7-25 19:49
任何数的 0 次方 返回的都是 1

正解
页: [1]
查看完整版本: 关于pow函数参数问题