Latest 0.1.2
Homepage https://github.com/shabib87/SHBinarySearchForRange
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation
Authors

Version
License
Platform

Overview

This cocoapod helps to find the nearest ceiling double/float value from a double/float array by performing a binary search operation.

Requirements

  • ARC
  • iOS8

Installation

SHBinarySearchForRange is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SHBinarySearchForRange"

Usage

#import "SHBinarySearchForRange.h"

NSArray *array = @[@0.12f, @0.23f, @0.3f, @0.345f, @0.967f, @1.0f];
SHBinarySearchForRange *binarySearch = [[SHBinarySearchForRange alloc] initWithValues:array];

NSInteger index = [binarySearch indexOfClosestCeilingForSearchItem:10.67575f];
NSNumber *valAtIndex = [array objectAtIndex:index];

NSLog(@"Value close to range: %f", valAtIndex.doubleValue);

Author

Ahmad Shabibul Hossain

License

SHBinarySearchForRange is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SHBinarySearchForRange",
    "version": "0.1.2",
    "summary": "A simple library to perform binary search to find the nearest double/float value from a double/float array for a given double/float.",
    "description": "This cocoapod helps to find the nearest ceiling double/float value from a double/float array by performing a binary search operation.",
    "homepage": "https://github.com/shabib87/SHBinarySearchForRange",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ahmad Shabibul Hossain": "[email protected]"
    },
    "source": {
        "git": "https://github.com/shabib87/SHBinarySearchForRange.git",
        "tag": "0.1.2"
    },
    "social_media_url": "https://twitter.com/shabib_hossain",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "SHBinarySearchForRange/Classes/**/*",
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This