Sign In with your Yahoo! ID or Join Now

Module Reference: Number Modules

This module provides basic arithmetic operations.

Module Input: number | Module Output: number

Simple Math Module

This module performs simple mathematical operations. These include addition, substraction, multiplication, division, modulo, and powers.

Example: Run this Pipe | View Source

This example uses Simple Math to truncate a news feed to the nearest multiple of five. If the feed has 12 items, it's truncated to only 10. 24 items are cut back to 20.

The Science Daily's "Science and Math" feed is piped into a Split module. One output of Split is piped into a Truncate module, the other output is piped into a Count module.

The Count module pipes into two Simple Math modules. The first Simple Math calculates "count % 5". The second Simple Math has the first module's output wired into its value field. The combined calculation is now "count - (count % 5)". This final value is wired back into the value field of Truncate.

Copyright © 2014 Yahoo! Inc. All rights reserved.