Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - 日本語

Change language to:
English - 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ヘルプ >> Code Matlab => Scilab > Compatible fonctions > mtlb_uint64

mtlb_uint64

Matlab uint64 emulation function

Description

Matlab and Scilab uint64 behave differently :

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

Let imax = 2^64 - 1 = 18 446 744 073 709 551 615.

xuint64(x)mtlb_uint64(x)
%nan00
-%inf00
-2imax-10
-1imax0
000
111
10.21010
10.51011
10.511011
.........
imaximaximax
imax+10imax
imax+11imax
%infimaximax

mtlb_uint64 has not to be used for hand coded functions.

The function mtlb_uint64(A) is used by mfile2sci to replace uint64(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_uint32 Compatible fonctions mtlb_uint8 >>

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:
Mon Jan 03 14:38:07 CET 2022