Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Code Matlab => Scilab > Compatible fonctions > mtlb_uint16

mtlb_uint16

Matlab uint16 emulation function

Description

Matlab and Scilab uint16 behave differently :

  • Beyong the main interval bounds, Scilab's uint16() wraps, while Matlab's mtlb_uint16() saturates.
  • For non integer values, Scilab's uint16() truncates the fractional part, while Matlab's mtlb_uint16() rounds to the nearest integer.

xuint16(x)mtlb_uint16(x)
%nan00
-%inf00
-2655340
-1655350
000
222
10.21010
10.51011
10.511011
.........
655356553565535
65536065535
65537165535
%inf6553565535

mtlb_uint16 has not to be used for hand coded functions.

The function mtlb_uint16(A) is used by mfile2sci to replace uint16(A) when it is not possible to know what is the input while porting Matlab code to Scilab. This function then determines the correct semantic at run time.

Report an issue
<< mtlb_true Compatible fonctions mtlb_uint32 >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:22 CET 2020