zoukankan      html  css  js  c++  java
  • [ Skill ] 中如何获取内置的数学常量?

    https://www.cnblogs.com/yeungchie/

    • code
    defMathConstants(s_id)
    
    • describe
    1. s_id 类型为 symbol
    2. 通过 s_id.Name 获取目标常量。
    Name Meaning
    E The base of natural logarithms. (e)
    LOG2E The base-2 logarithm of e
    LOG10E The base-10 logarithm of e
    LN2 The natural logarithm of 2.
    LN10 The natural logarithm of 10.
    PI The ratio of the circumference of a circle to its diameter.(π)
    PI_OVER_2 π / 2
    PI_OVER_4 π / 4
    ONE_OVER_PI 1 / π
    TWO_OVER_PI 2 / π
    TWO_OVER_SQRTPI
    SQRT_TWO (The positive square root of 2.)
    SQRT_POINT_FIVE (The positive square root of 1/2.)
    INT_MAX The maximum value of a SKILL integer.
    INT_MIN The minimum value of a SKILL integer.
    DBL_MAX The maximum value of a SKILL double.
    DBL_MIN The minimum value of a SKILL double.
    SHRT_MAX The maximum value of a SKILL "short" integer.
    SHRT_MIN The minimum value of a SKILL "short" integer.

    The minimum value of a SKILL integer is -2147483648.
    The minimum literal value which may appear in a program is -2147483647.

    • example
    ; 获取 π
    defMathConstants('ycMath)
    printf("%f
    " ycMath.PI)
    
    =>3.141593
    =>t
    
  • 相关阅读:
    html笔记
    Git入门学习总结
    使用OpenSSH远程管理Linux服务器
    Linux 网卡驱动的安装
    vi的使用
    Linux下常用的数据恢复工具
    网络文件系统(NFS)的使用
    文件系统管理
    磁盘存储管理
    用户权限管理
  • 原文地址:https://www.cnblogs.com/yeungchie/p/13420400.html
Copyright © 2011-2022 走看看