blockly > utils > מתמטיקה > הצמדה

הפונקציה utils.math.clamp()

מהדקים את המספר שצוין בין הגבול התחתון לגבול העליון.

Signature:

export declare function clamp(lowerBound: number, number: number, upperBound: number): number;

פרמטרים

פרמטר סוג תיאור
lowerBound number הגבול התחתון הרצוי.
number number המספר שצריך להצמיד.
upperBound number הגבול העליון הרצוי.

החזרות:

number

המספר המוצמד.