【錯誤】 y1重定義,以前的定義是“函數”


前幾天定義y1出現這樣的報錯,沒管改成y11就繼續寫,今天比賽又忘記這個,趕緊上網查查是什么原因,這個y1在math.h里定義過了。繼續打開math.h - corecrt_math.h 

 

 發現,不僅是y1,連j0,j1,jn,y0,yn都被定義了

作用:

Function: double j0 (double x)
j0 returns the Bessel function of the first kind of order 0 of x. It may signal underflow if x is too large.

Function: double j1 (double x)
j1 returns the Bessel function of the first kind of order 1 of x. It may signal underflow if x is too large.

Function: double jn (int n, double x)
jn returns the Bessel function of the first kind of order n of x. It may signal underflow if x is too large.

Function: double y0 (double x)
y0 returns the Bessel function of the second kind of order 0 of x. It may signal underflow if x is too large. If x is negative, y0 signals a domain error; if it is zero, y0 signals overflow and returns -∞.

Function: double y1 (double x)y1 returns the Bessel function of the second kind of order 1 of x. It may signal underflow if x is too large. If x is negative, y1 signals a domain error; if it is zero, y1 signals overflow and returns -∞.

Function: double yn (int n, double x)yn returns the Bessel function of the second kind of order n of x. It may signal underflow if x is too large. If x is negative, yn signals a domain error; if it is zero, yn signals overflow and returns -∞.

大概意思就是返回一個貝塞爾函數什么什么的

參考:

Standard library header < math >

網上說有一個"gentlemen's agreement",在庫代碼中暴露未記錄的標識符會以下划線開頭或結尾,用戶代碼不會,只是為了避免這類問題。

 

用來解決的build command:

cl foo.cpp /Feb /D _CRT_DECLARE_NONSTDC_NAMES=0

感覺這是歷史遺留問題。。。。下次手動寫y11


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM