LogoLogo
Github
  • Overview
    • 📄Litepaper
  • GraphLinq Chain
    • Networks
      • Specs
        • Geth Client
        • Clique Consensus
      • GraphLinq Chain (Mainnet)
        • Wallet
          • Add GraphLinq Chain to Metamask
          • Add GraphLinq Chain To Ledger
        • RPC Public Nodes
        • Json-RPC API
        • Libraries
        • Execution Clients
        • Explorer
        • Status
    • GLQ
      • Allocation
      • Bridge
      • Rewards
  • 🎶Run a node
    • Installation
  • Dev tooling
    • Introduction
      • Vision
    • Graphs
      • What are Graphs and how do they work?
      • Creating a graph
      • File compression
      • Graph Cycle Costs
      • Node & Fees
    • Engine
      • Setting up the environment
      • Running an Engine locally
    • Dashboard Interface
      • Importing Graph/Template
      • Deploying a Graph
      • Managing Graph State
    • Blocks
      • Base Variable
        • Boolean
        • Decimal
        • Integer
        • KeyValue
        • Long
        • String
        • Get variable
        • Is Variable Exist
        • Set variable
        • Variable Portal
        • Secret String
      • Common
        • Entry Point
        • On Graph Start
        • Stop Graph
      • Time
        • Get Milliseconds Timestamp
        • Get Milliseconds Timestamp Offset
        • Get Timestamp
        • Get Timestamp Offset
        • Timer
        • Format Date
        • Millisecond Timestamp to Date
        • Timestamp to Date
        • Execution Time Interval
      • JSON
        • Last Node to JSON
        • Convert To JSON
        • Add JSON Property
        • Create JSON Object
        • JSON Deserialize To Array
        • JSON to JSON Object
        • Merge JSON
        • Serialize JSON Object
        • Serialize to JSON
      • Log
        • Print
      • WebSocket
        • WebSocket Client Close
        • WebSocket Client Connector
        • On WebSocket Client Disconnect
        • WebSock Receive Data Event
        • WebSocket Send Data
      • String
        • String Contains
        • Concat String
        • Replace String in String
      • Math
        • Subtract A - B
        • Add A + B
        • Ceiling
        • Divide A / B
        • Floor
        • Modulo A % B
        • Multiply A * B
        • Percentage Difference
        • Round
      • HTTP
        • Array To Body Values
        • Array To JSON Body
        • Put HTTP Request
        • Post HTTP Request
        • Get HTTP Request
        • Delete HTTP Request
      • Function
        • Function Block
        • Add Function Parameter
        • Set Function Result
        • Call Function
        • Get Function Result Parameter
        • Get Function Parameter
      • Transformers
        • String to Base64
      • Data
      • CSV
      • Base Condition
        • Decimal Branch
        • Integer Branch
        • String Branch
        • Boolean Branch
      • Range Condition
        • Decimal Range Branch
      • Array
        • Add Array Element
        • Clear Array
        • Create Array
        • Each Element In Array
        • Get Array Element At Index
        • Get Array Size
        • Keep Last X Elements In Array
      • Dictionary
      • Hosted API
    • Blocks (Messaging)
      • Twitter
      • Twitch
      • Telegram
      • SMTP
      • ShortenURL
      • PushOver
      • PushBullet
      • OpenAI
      • Discord
        • Add Emoji On Message
        • Send Discord Channel File
        • Add Role User
        • On Discord Channel Message
        • On Reaction Added Message
        • On Reaction Removed Message
        • Remove Role User
        • Reply Private Discord Message
        • Send Discord Channel Message
        • Discord Connector
        • On Discord Private Message
    • Blocks (Exchange)
      • Binance
      • Bitfinex
      • Bittrex
      • CoinEx
      • CoinGecko
        • Get CoinGecko Coin
      • Huobi
      • Kraken
      • KuCoin
      • LiveCoinWatch
      • MXC
    • Blocks (Blockchains)
      • Avalanche
        • Network Blocks
          • Avalanche Connector
          • Get Block Parameters
          • Get Transaction Parameters
          • On Avalanche Block
          • On Avalanche Transaction
        • Avascan
          • Get Avascan Supply
          • Get Avascan Global Stats
          • Get Avascan Staking Stats
          • Get Avascan Burned Fees
        • SnowTrace
          • SnowTrace Connector
          • Get ERC-20 Balance For Contract
          • Get ERC-20 Token Supply
          • Get Total AVAX on C-Chain
          • Get AVAX Balance Single Address
      • Binance Smart Chain
        • Network Blocks
          • Binance Smart Chain Connector
          • On Binance Smart Chain Block
          • On Binance Smart Chain Transaction
          • On Binance Smart Chain Wallet Transaction
        • BEP20 Blocks
          • Create BEP20 Token
          • Deploy BEP20 Token
      • Elrond
        • Elrond Connector
        • Get Elrond HyperBlock By Hash
        • Get Elrond Transaction
        • Get Elrond Wallet Balance
      • Ethereum
        • Ethereum Connector
        • On Ethereum Block
        • On Ethereum Transaction
        • On Ethereum Wallet Transaction
        • Estimate Gas Price
        • Get Ether Balance
        • Get Block Parameters
        • Get Transaction Parameters
        • Etherscan
          • Etherscan Connector
          • Etherscan Get Gas Price
        • Ethereum Managed Wallet
          • Get Personal Managed Wallet
        • Ethereum ERC20
          • Get ERC20 Holders
          • Get ERC20 Balance
          • Get ERC20 Information
          • Create ERC20 Token
          • Deploy ERC20 Token
        • Ethereum NFT
          • Create NFT Contract
          • Deploy NFT Contact
          • Create New Mintable NFT Token
          • Deploy New Mintable NFT Token
      • Polygon
        • Polygon Connector
      • Quickswap
        • Get Quickswap Pair Price
        • Get Quickswap Token Price
        • Get Quickswap LP Token
        • Get Quickswap LP Token Price
        • On Quickswap Swap
        • On Quickswap Sync
      • Unicrypt
        • Get Unicrypt Locked Token Parameters
        • Get Unicrypt Locked Tokens
        • Get Unicrypt Total Locked Liquidity
        • Get Unicrypt All LP Locked Tokens Address
        • On Unicrypt Deposit
      • Uniswap
        • Get Uniswap LP Token
        • Get Uniswap LP Token Price
        • Uniswap Get Pair Price
        • Get Uniswap Token Price
        • On Uniswap Swap
        • On Uniswap Sync
      • Solana
    • Blocks (Charting)
      • Generate Time Series One Line Chart
      • Generate Time Series Two Line Chart
    • Blocks (Machine Learning)
      • Spam Detection
      • Sentiment Analysis
    • Node Connector Colors
      • Strings & Variables
      • Execution Logic (Yellow)
      • Integers (orange)
      • Booleans (pink)
    • Block Execution Order
      • Additional Block Execution
    • Block Color
      • Colors & Meaning
    • Block Type Overview
      • Function Type
      • Entry Point Type
      • Event Trigger Type
      • Variable Type
      • Condition Type
      • Connector Type
  • Nocode Users
    • Instant Deploy Wizard
    • GraphLinq Marketplace
  • Twitter
  • Medium
  • Github
  • GraphLinq Explorer
  • Audit Report
Powered by GitBook
On this page
  • Block Description
  • Input Parameters
  • Output
  • Example Use Case
  • Conclusion
  • More Information
  • Full Example
  1. Dev tooling
  2. Blocks
  3. Math

Add A + B

Addition operations on numeric values

The Add A + B block in the GraphLinq IDE is a fundamental mathematical component that allows developers to perform addition operations on numeric values. This block is a fundamental arithmetic operation that enables the combination of two numeric inputs to produce a single output representing their sum.

Block Description

The Add A + B block is categorized under the Math blocks in the GraphLinq IDE. Like other blocks in this category, it is a non-executive block, which means it does not have any yellow connectors and is implicitly called whenever its output is needed as input by other blocks during graph execution.

Input Parameters

The Add A + B block requires two input parameters:

  1. A (Numeric Type): The A input represents the first numeric value to be added.

  2. B (Numeric Type): The B input represents the second numeric value to be added.

Both A and B can accept various numeric data types, such as integers, decimals, and longs.

Output

The Add A + B block outputs the result of the addition operation performed on the input values A and B. The output is of the same data type as the input values and represents the sum of A and B.

Example Use Case

Let's explore a practical example of how the Add A + B block can be used within a graph to calculate the total price of items in a shopping cart.

  1. The graph receives real-time price data for each item in the shopping cart, expressed as decimal values (e.g., 10.50, 25.75, etc.).

  2. The Add A + B block is called, taking the individual item prices as inputs A and B.

  3. The block performs the addition operation, combining the prices of two items to calculate the total price.

  4. The resulting sum (e.g., 36.25) is further processed or used in subsequent calculations within the graph.

In this example, the Add A + B block plays a crucial role in calculating the total price of the items in the shopping cart by summing the individual item prices. The simplicity and efficiency of the Add A + B block make it an essential tool for performing basic arithmetic operations on numeric data in various graph scenarios.

Conclusion

The Add A + B block provides a straightforward and efficient solution for performing addition operations on numeric values in the GraphLinq IDE. By using this block, developers can easily combine two numeric inputs to produce a single output representing their sum. Whether it's for financial calculations, data aggregation, or any other scenario involving numeric data, the Add A + B block proves to be a valuable asset in achieving accurate and reliable results.


More Information

The Add A + B block is a fundamental component in the GraphLinq IDE, designed to calculate the sum of two numeric values, A and B. This block takes two inputs, "A" and "B," and efficiently computes their sum. The output of this operation is the numerical result of adding A and B together.

Block Details:

Add A + B blocks have two input parameters: "A" and "B." These input parameters can accept various types of numeric data, such as decimal, integer, or long. Additionally, "A" and "B" can have different data types, enabling users to add a decimal value to an integer value or vice versa.

Execution:

Similar to other block types in the Math category, Add A + B blocks are non-executive blocks. They do not have yellow connectors, which means they are not explicitly called by other blocks and cannot call other blocks themselves. Instead, they are implicitly called whenever their output is required as input by some other executing block.

Use Case:

The Add A + B block finds extensive applications in various domains where numerical addition is necessary. It is commonly used in financial calculations, data analysis, and general arithmetic operations. For instance, in financial applications, this block can be used to calculate total investment amounts, revenue projections, or asset valuations.

Example:

Let's consider an example to demonstrate the functionality of the Add A + B block. Suppose we have a graph that calculates the total sales revenue for a business. The graph takes inputs "A" and "B," representing the revenue from two different product lines. The Add A + B block then computes the total revenue by adding the revenue from both product lines together.

The output of the Add A + B block represents the overall sales revenue, which can be further processed or displayed using other blocks in the graph. The graph can be configured to update in real-time, allowing business owners to monitor their total revenue dynamically as it changes.

This example illustrates the implicit calling of the Add A + B block, as it is executed only when its output is required by another block's input. By utilizing the Add A + B block, developers can perform efficient addition operations within their graphs, making it easier to perform complex calculations and data processing tasks.

The versatility of the Add A + B block makes it an indispensable tool for developers seeking to perform mathematical computations within their graphs. Whether it's summing financial data, calculating statistical measures, or performing general arithmetic operations, the Add A + B block offers a straightforward and effective solution for adding numerical values together.


Full Example

Add A + B blocks, as the name suggests, simply add two given numbers together and then output the result.

Add A + B blocks have two input parameters called "A" and "B". These are, of course, the two numbers we want to add together. Note that these input parameters can be supplied with any type of numeric data (decimal, integer, long), and the two data types do not need to match (ie: you can add a decimal value to an integer value).

Note that the yellow executive output on the Get Wallet Informations block is plugged directly into the Print block, which means that this is the next block to be called after the Get Wallet Informations block. However, for the Print block to execute, its "Message" parameter must be supplied with a value. This causes the Replace String In String block to resolve, which in turn causes the Add A + B block to resolve. This is an example of implicit calling, where a non-executive block is called only when its output is required by some other block's input.

In our example, we simply calculate and then print the wallet's transaction volume one time, right when the graph starts running. It is easy to imagine a more fleshed-out and realistic example in which this calculation is done whenever requested by users on some platform like Discord or Telegram.

PreviousSubtract A - BNextCeiling

Last updated 1 year ago

As with all block types in the category, Add A + B blocks are non-executive blocks, which means that they have no yellow connectors, and thus they are never called explicitly by other blocks, and they themselves cannot call other blocks. Instead, they are called implicitly whenever their output is required as input by some other block that is executing. We can observe this happening in the example below.

In the example above, we use a Get Wallet Informations block to access information about a specific bitcoin wallet one time when the graph starts. We then use our Add A + B block to add together the total amount received and the total amount sent by this wallet, in order to calculate the total transaction volume across this wallet's history. Finally, we build a little output message containing this result using a block. and then print it into our graph's logs using a block.

Math
Replace String In String
Print