logo
  • 教程列表
  • SO官方文檔
  • 數學模組
    • 圓形地板 ceil trunc
    • 三角
    • 對數
    • 常量
    • 無窮大和 NaN(不是數字)
    • 更快取冪的動力
    • 複製標誌
    • 虛數
    • 複數和 cmath 模組
  1. StackOverflow 文件
  2. Python Language 教程
  3. 數學模組
  4. 複製標誌

複製標誌

Created: November-22, 2018

在 Python 2.6 及更高版本中,math.copysign(x, y) 以 y 的符號返回 x。返回的值始終是 float。

Python 2.x >= 2.6

math.copysign(-2, 3)    # 2.0
math.copysign(3, -3)    # -3.0
math.copysign(4, 14.2)  # 4.0
math.copysign(1, -0.0)  # -1.0, on a platform which supports signed zero
  • 虛數
  • 更快取冪的動力

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明