تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["`Number.toShort()` casts a given number to a signed 16-bit integer, effectively restricting its value range to [-32768, 32767]."],["Casting floating-point numbers using this method results in the loss of decimal precision, returning only the integer part."],["If the input number exceeds the maximum value for a signed 16-bit integer (32767), the function returns 32767."],["Similarly, if the input number falls below the minimum value for a signed 16-bit integer (-32768), the function returns -32768."]]],["The `toShort()` method casts a number to a signed 16-bit integer, ranging from -32768 to 32767. Floating-point numbers lose decimal precision when cast. Values exceeding the maximum (32767) are converted to 32767, and values below the minimum (-32768) become -32768. The method takes a number as input and returns a signed 16-bit integer.\n"]]