لو سمحتو حدى يرد على سؤالي اذا بتعرفو شو الفرق بين
MATH.CMATH
لو سمحتو ضروري
لو سمحتو حدى يرد على سؤالي اذا بتعرفو شو الفرق بين
MATH.CMATH
لو سمحتو ضروري
لو سمحتو شوالفرق بين math, cmath
للضرورة القصوى
وشكرا على مساعدتكم
يمكن وحده من المكتبتين فيه دوال (functions) اكثر للرياضيات
"مجرد رأي"
IDE : Microsoft Visual Studio 2005 Pro
اقتباس<math.h> vs. <cmath>
Cfront had a include file <math.h> corresponding to the same in C. KAI C++ supplies a similar <math.h>, so codes using it should compile without difficulty.
However, you may eventually want to migrate to using the ISO header <cmath>. Though the migration is fairly painless, you should be ready for the following surprise. The header <cmath> introduces overloaded prototypes for math functions such as sqrt. These prototypes declare them for float and long double, and are invaluable for writing templates that work for all precisions. However, these extra prototypes add ambiguity to formerly unambiguous calls. For example, in the code below:
#include <cmath>
double golden_ratio() {return (sqrt(5)+1)/2;}
the call sqrt(5) cannot be resolved because the (int) 5 could be converted to a float, double, or long double. When switching from <math.h> to <cmath>, you need to add casts to disambiguate such calls. For instance, the aforementioned example can be fixed by replacing the argument 5 with 5. or (double)5.
http://arcknowledge.com/lib.fox-toolkit.us...6/msg00335.html
هذا الموضوع مغلق.
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…