up: BYTE     index Zimbu documentation

CLASS BYTE.byte @public

summary

     

The builtin type byte: 8 bit natural number.

Although this is a separate type, the methods for nat are used. Listed here are only the methods that differ from the nat methods.

NOTE: When compiled to Javascript a byte is stored as a float, since Javascript only supports float numbers.

$Size() int @public  Return the number of bytes in a byte.
$ToString() string @public  Return the number in decimal form.
$ToString(format) string @public  Return the number in the specified format.
 
 

members (alphabetically)

     

FUNC $Size() int @public

     

Return the number of bytes in a byte.

Always returns 1, since a byte is 8 bits

FUNC $ToString() string @public

     

Return the number in decimal form.

For example, b.ToString() returns "123" when b has this value.

FUNC $ToString(string format) string @public

     

Return the number in the specified format.

See nat.ToString(format) for the possible formats.

license

      Copyright 2014 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0