อันนี้เป็นปัญหาค่า Constant value ในโปรแกรมต่างๆ ของเรา แต่เป็นโชคดีของ ค่า PI ที่เรามันวิธีแก้ปัญหานี้อย่างฉลาดๆ
เนื่องจาก Intel math co-processor ได้รวมคำสั่ง ที่สามารถนำ ค่า PI จาก processor มา push ลง stack ได้ คือ fldpi ดูตัวอย่างนะครับ
#include "stdio.h"
class cPI { public: operator double () const { double Pi; _asm { fldpi; // Push the constant pi to the x87 stack fst Pi; // Store to Pi } return Pi; } };