LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lp.ascii_ui64rest

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax

‘buffer’,value = lp.ascii_ui64rest('value1' , 'value2');

Description

The lp.ascii_ui64rest LUA function provides the remainder of a division between two unsigned 64 bits values coded and defined as the character string ‘value1 ‘ and  ‘value2’.

With huge number in Standard LUA , the usage of double generate calculation error on unsigned 64 bits number. As unsigned 64 bits numbers are more currently used in SNMP V2 it is mandatory to use these 64 bits functions available in the LoriotPro environment for the manipulation of 64 bits counter for example.

Parameters

value1 - An usigned 64 bits number defined in a character string

value2 - An usigned 64 bits number defined in a character string

Return Values

value : The result of the operation as a double

Return nil if an error occurs

buffer : The result of the operation as a character string representing an unsigned 64 bits value.  

Return nil if an error occurs

Example

buffer,value=lp.ascii_ui64rest('0xFF' , '20');
lp.Print(buffer," ",value,"\n");
buffer,value=lp.ascii_ui64rest('1000000000022' , '20');
lp.Print(buffer," ",value,"\n");
buffer,value=lp.ascii_ui64rest('900000100000000021' , '20');
lp.Print(buffer," ",value,"\n");

remainder of lua division

 


www.loriotpro.com