Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский
Scilab Help >> Compatibility Functions > 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.

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 14:57:46 CET 2019