تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
لتحديد الرقم زوجي ام فردي (طريقه سريعه جدا )
#1
كاتب الموضوع : AhmedEssawy


كود :
Public Function IsOdd(ByVal lngNumber as Long) as Boolean

'When executing 10000000 times the code below takes
'about 20 seconds to execute.
'IsOdd = IIf((lngNumber And &H1) = 1, True, False)

'When executing 10000000 times the code below takes
'about 20 seconds to execute.
'IsOdd = IIf((lngNumber Mod 2) = 0, False, True)

'When executing 10000000 times the code below takes
'about 6 seconds to execute.
IsOdd = NOT (lngNumber AND &H01)

'Measurements are made on a Pentium 733 MHz

End Function
}}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  لتحديد الرقم زوجي ام فردي RaggiTech 0 2,743 17-10-12, 12:55 AM
آخر رد: RaggiTech
  تحويل الرقم العشري الي Bin- Oct- Hex RaggiTech 0 1,970 17-10-12, 12:33 AM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم