ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the difference between Int and Fix functions?

Both returns the integer portion of a number.

user-image
تم إضافة السؤال من قبل Muhammad Shahid Farooq , Software Engineer, System Integrator , ForeVision Business Solutions
تاريخ النشر: 2016/02/01
Pravin Kadam
من قبل Pravin Kadam , IT Executive , Sun Pharmaceutical Ind. Ltd.

Both Int as well as Fix functions will return the integer part of a decimal number.

But if the decimal number is negative then,

  • Int function will return a number that is1 less than the integer part.
  • Fix function will return the integer part of the negative number as it is

For e.g. Int(9.) =9 and Fix(9.) =9

but Int(-9.) = - and Fix(-9.) = -9

Musna Mony
من قبل Musna Mony

The 'Int' function returns the first negative integer less than or equal to number, whereas 'Fix' function  returns the first negative integer greater than or equal to number.

Faisal Rehman
من قبل Faisal Rehman , Managing Consultant , Systems

The difference between int and fix functions is that if Number is negative, int returns the first negative integer less than or equal to Number, where as fix returns the first negative integer greater than or equal to Number

Saleh Almakki
من قبل Saleh Almakki , Operator , Saudi Aramco

Brifely:1.3 is returned as1 by Int function and returned as2 by Fix function

المزيد من الأسئلة المماثلة