Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

contained-periodic-values

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contained-periodic-values

Find how many values of a discrete periodic function are contained in an interval.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47K
increased by31.91%
Maintainers
1
Weekly downloads
 
Created
Source

contained-periodic-values.js

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

Find how many values of a discrete periodic function contained in an interval.

What are discrete periodic functions?

Periodic functions are functions that repeat. Discrete functions are functions whose values do not connect. An example of a discrete periodic function is the function of "Wednesdays" on a calendar. Wednesdays are discrete values along a timeline, and they repeat every 7 days.

What might I use this library for?

Continuing the example from above, this library could be used to determine the number of Wednesdays between two days. You could extend this to find the number of work days or week days between two days.

Terminology

The members of a periodic function's output are the "values." A single member is a "value."

The distance that the function repeats itself along is the "period."

An interval is defined by a "start" and "end".

API

containedPeriodicValues(start, end, value, period)

Find the number of values contained with the "start" and "end." This method works with intervals with inclusive starts and exclusive ends. In math syntax, this would be written as [start, end).

The order that you specify the start and end does not matter.

Keywords

FAQs

Package last updated on 03 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc