الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

شو الفرق بين math,cmathtفي البرمجة

مغلق
بدأه الملاك الحزين في 14 مايو 2007 · 3 رد · 555 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

لو سمحتو حدى يرد على سؤالي اذا بتعرفو شو الفرق بين

MATH.CMATH

لو سمحتو ضروري

#2

لو سمحتو شوالفرق بين math, cmath

للضرورة القصوى

وشكرا على مساعدتكم

#3

يمكن وحده من المكتبتين فيه دوال (functions) اكثر للرياضيات

"مجرد رأي"

:::كوت بو 6:::

IDE : Microsoft Visual Studio 2005 Pro

#4
اقتباس

<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

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…