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
    
  • 相关阅读:
    linux 进程间通信之pipe
    makefile详解
    makefile基础
    std::list 源代码解析
    各类编译器 allocator 底层
    oop &&GP 模板 ---> 特化和偏特化
    STL Allocator
    关联式容器
    vector::erase
    maven
  • 原文地址:https://www.cnblogs.com/yeungchie/p/13420400.html
Copyright © 2011-2022 走看看