Logo Logo en
  • iRidi Pro
    Major Components
    • i3 pro app
    • iRidi Pro Server
    • iRidi Studio
    • iRidium studio v. 1.3.8 (old version)
    Java Script in iRidi
    • Guide
    • Handbook
    • Samples
    • JS drivers
    others
    • My Account
    • iRidium Cloud
    • iRidium Transfer
    • Push notifications
    • Best practice
    Licensing policy
    • Licensing and giving ownership rights
    • Offline Licensing
    • iRidi Pro Server Activation
  • Products
    i3 lite
    • i3 lite app
    • Registration and licensing
    • Server
    • Modules
    KNX Home Server
    • i3 KNX app
    • KNX Home Server
    BUS77 HOME SERVER
    • Bus77 Home and Bus77 Lite apps
    • Bus77 Home Server
    Solutions
    • BYOD - solution for hotels
    • PMS - solution for buildings
    iRidi SCADA
    • iRidi SCADA
  • bus77_
    SETTING UP BUS77
    • Bus77 Basics
    • Bus77 Home and Bus77 Lite apps
    • Working with the Bus77 driver in iRidi Studio
    • Configuring the Bus77 in iRidi Studio
    BUS77 PROTOCOL
    • Characteristics of CAN (Bus77)
    • Исходники на GitHub
    Bus77 equipment
    • Bus77 Pro catalog
    • Bus77 Lite catalog
  • Works with
    Drivers
    • List of drivers
    • ProAV Drivers
    • AV & Custom Systems
    • JS drivers
    Protocols and interfaces
    • Voice Control
    • 1-Wire
    • BACnet IP
    • bus77_
    • KNX
    • KNX IP BAOS
    • Weinzierl kBerry
    • Microsoft Exchange
    • Modbus
    • MQTT
    • NFC
    • ODBC
    • Onvif
    • SIP
    • SNMP
    • Wake On Lan
    • Z-Wave
    • ZigBee
    Manufacturers
    • AMX
    • AVCiT
    • Beckhoff ADS
    • Biamp Tesira
    • Bluesound
    • Casambi
    • BSS Harman
    • Clipsal
    • ControlArt 7Port
    • Crestron
    • DigiBird
    • Domintell
    • Duotecno
    • EIDE
    • EPSNET
    • Global Cache
    • HDL Buspro
    • Helvar
    • IEAST
    • INELS BUS
    • INELS Wireless
    • Intesis
    • Kleger
    • Kramer VIA
    • Kramer 3000
    • Larnitech
    • Legrand Netatmo
    • LG TV
    • Lutron
    • Lutron Homeworks QS
    • MyHome
    • Nest
    • Novastar
    • Panasоnic PTZ
    • Philips Dynalite
    • PJLink
    • Satel
    • SamsungTV
    • Sonos
    • Somfy
    • SpinetiX
    • Televic Conference
    • TIS
    • Tion
    • URRI
    • Velbus
    • Velocio
    • Vinteo
    • WyreStorm
    • WiiM
    • Xicato
    • Yamaha
    • ZONT
    • Z-Wave.me
    Tested equipment
    • HDL S57 panel
    • HDL S10 panel
    • Intercom (SIP)
    • Akuvox
    • Arlight
    • Divus
    • QBic TD-1050 PRO
    • QBic TD-1060 Slim
    • QBic TD-1070
    • Sigur
    • Uni-Ubi
    • Velocio
  • iRidi equipment

    Servers
    • HS Server
    • ProAV Control Processor Basic
    • ProAV Control Processor Advanced
    • UMC Controller Specification
    • UMC C2 setting up
    • UMC C3 setting up
    • HDL IntelliCenter 2 (UMC C4) setting up
    Модули расширения
    • I-PX-RS1
    • I-PX-RS4
    • I-PX-IR3
    KNX
    • KNX Home Server
    • KNX IP Interface
    Control panels
    • iRidium Panel 7
    • Touch Panel P3
    • Touch Panel P6
    • Touch Panel P8
    • Touch Panel P10
    • Tabletop Touch Panel 10
    • AV Remote Control
    Bus77 equipment
    • Bus77 Pro catalog
    • Bus77 Lite catalog
    • Differences
iRidium mobile web-site
Contents
    Tools‌
    • Page information
    • Permanent link
    • Printable version
    • Special pages
    • Related changes
    • What links here
    Login / Create Account
    From for iRidium developers
    Jump to: navigation, search
    This page is a translated version of the page CreateBigIntContext and the translation is 100% complete.

    Contents

    • 1 IR.CreateBigIntContext()
      • 1.1 .Add
      • 1.2 .Exp
      • 1.3 .ModExp
      • 1.4 .Sub
      • 1.5 .Mul
      • 1.6 .Sqr
      • 1.7 .Gcd
      • 1.8 .Div
      • 1.9 .HexToDec
      • 1.10 .DecToHex

    IR.CreateBigIntContext()

    Method to create a large number.

    Syntax

    IR.CreateBigIntContext(bool)

    input value description
    bool false type: Boolean
    format of a number:
    true - number in hex format;
    false - number in decimal format.
    output
    result 11111111111111... type: number
    large number.


    Sample

    var DBigNum = IR.CreateBigIntContext(false)
    var DValue1 = "11111111111111111111111111111111111111111111111111111111"
    var DValue2 = "11111111111111111111111111111111111111111111111111111111"
    IR.Log(DBigNum.Add(DValue1, DValue2))




    Futher on you'll find description of methods that can be used with large numbers.

    .Add

    Addition of large numbers (r = a + b).

    Syntax

    HBigNum.Add(a, b)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r 1E type: number
    result of addition of large numbers.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Add("F", "F"))





    .Exp

    Exponent (r = a ^ p).

    Syntax

    HBigNum.Exp(a, b)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r 03E8 type: number
    result of exponentation.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Exp("A", "3"))





    .ModExp

    Getting the remainder of an exponential number divided by m (r = a ^ p % m).

    Syntax

    HBigNum.ModExp(a, p, m)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r 08 type: number
    result of exponential operation and getting the remainder from dividing large numbers.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.ModExp("2", "3", "A"))





    .Sub

    Substraction of large numbers (r = a - b).

    Syntax

    HBigNum.Sub(a, b)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r F5 type: number
    result of substracting large numbers.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Sub("FF",  "A"))





    .Mul

    Multiplication oof large numbers (r = a * b).

    Syntax

    HBigNum.Mul(a, b)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r D2 type: number
    result of substraction of large numbers.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Mul("F",  "E"))





    .Sqr

    Squaring large numbers (r = a ^ 2).

    Syntax

    HBigNum.Sqr(a)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r 64 type: number
    result of squaring large numbers.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Sqr("A"))





    .Gcd

    Calculation of the greater common divisor (r = (a, b)).

    Syntax

    HBigNum.Gcd(a, b)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r 05 type: number
    the greater common divisor of a and b.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Gcd("FF", "AF"))





    .Div

    Wholenumber division of large numbers (r = a / b).

    Syntax

    HBigNum.Div(a, b)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    output
    r 0199 type: number
    result of wholenumber division.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.Gcd("FFF", "A"))





    .HexToDec

    Conversion of a hex number into a decimal one.

    Syntax

    HBigNum.HexToDec(a)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    a "C" type: number
    number in the hex system.
    output
    result 12 type: number
    result of number conversion into a decimal one.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.HexToDec("С"))





    .DecToHex

    Conversion of a large decimal number into a hex one.

    Syntax

    HBigNum.DecToHex(a)

    input value description
    HBigNum IR.CreateBigIntContext(true) type: object
    pointer to a large number.
    a "10" type: number
    number in the decimal system.
    output
    result 0A type: number
    result of number conversion into a hex one.


    Sample

    var HBigNum = IR.CreateBigIntContext(true)
    IR.Log(HBigNum.DecToHex("10")) // result: 0A




    Retrieved from "https://dev.iridi.com/index.php?title=CreateBigIntContext/en&oldid=101316"
    About us
    Company
    Team
    History
    Philosophy
    Rewards
    Partnership
    Our partner
    Partnership Programs
    Apply for partnership
    products
    iRidium pro
    iRidium lite
    iRidium gate
    iRidium server
    Loads
    iRidium pro
    iRidium lite
    Other version
    Marketing materials
    Support
    On-line courses/Video
    Recommended equipment
    Other version
    iRidium pro
    Documentation
    FAQ
    Forum
    iRidium lite
    Documentation
    Forum
    Projects
    Standart projects
    Smart buildings
    Smart house
    Special solution
    Find a dealer
    News
    Youtube
    Twitter
    VK
    Logo
    contact@iridi.com
    +7 (499) 322-73-29

    Privacy policy