A library for calculating on string data.

Overview

FookCalc

License MIT Public Yes Platform API

What is FookCalc?

A library for calculating on string data.

Gradle

Add the following to your project's root build.gradle file

repositories {
    maven {
        url "https://jitpack.io"
    }
}

Add the following to your project's build.gradle file

dependencies {
    implementation 'com.github.ibrahim-ekinci:FookCalc:1.1.3'
}

Usage

Kotlin

Fook.calc("44+4")//It will return 48 as a double.
//or
"44+4".calculate()//It will return 48 as a double.(string extension)

Java

Fook.calc("44+4");//It will return 48 as a double.

Abilities

Constants

"π".calculate() //It will return 3.14159265358979323846
"e".calculate() //It will return 2.7182818284590452354
"φ".calculate() //It will return 1.6180339887
"-4".calculate() //It will return -4
"+4".calculate() //It will return +4

Operations

"44-4".calculate() //It will return 40
"44+4".calculate() //It will return 48
"44*4".calculate() //It will return 176
"44/4".calculate() //It will return 11
"80%20".calculate() //It will return 16(20 percent of 80)
"2^4".calculate() //It will return 16(2 to the power of 4)

Functions

"sqrt(4)".calculate() //It will return root of 4
"√(4)".calculate() //It will return root of 4 
"ln(4)".calculate() //It will return ln of 4
"log(4)".calculate() //It will return log 10 of 4
"abs(-4)".calculate() //It will return 4(absolute value)
"sin()".calculate() //It will return sine of 40
"cos(40)".calculate() //It will return cosine of 40
"tan(40)".calculate() //It will return tangent of 40
"cot(40)".calculate() //It will return cotangent of 40
"asin(40)".calculate() //It will return arc sine of 40
"acos(40)".calculate() //It will return arc cosine of 40
"atan(40)".calculate() //It will return arc tangent of 40 
"acot(40)".calculate() //It will return arc cotangent of 40
"sinh(40)".calculate() //It will return sine hyperbolic of 40
"cosh(40)".calculate() //It will return cosine hyperbolic of 40
"tanh(40)".calculate() //It will return tangent hyperbolic of 40
"coth(40)".calculate() //It will return cotangent hyperbolic of 40
//** NOTE: Calculated by converting trigonometric functions to radians. **

Extras

Brackets: You can just use standard parentheses. There is no limit to the use of parentheses.
Decimal numbers: You can show the fraction with a dot(".").

"((3.5124)+(5.3))*(2+6.7)".calculate() //It will return 76.66788

Example

"((4 - 2^3 + 1) * -sqrt(3 * 3 + 4 * 4)) / 2 + ln(π)".calculate() //It will return 8.6447298858494
"((4-2^3+1)*-sqrt(3*3+4*4))/2+ln(π)".calculate() //It will return 8.6447298858494

Formula Book

This library is used in the basic calculations of the Formula Book application supported by TÜBİTAK.
Download on Google Play

Contribution, Issues or Future Ideas

If part of FookCalc is not working correctly be sure to file a Github issue. In the issue provide as many details as possible. This could include example code or the exact steps that you did so that everyone can reproduce the issue. Sample projects are always the best way :). This makes it easy for our developers or someone from the open-source community to start working!

If you have a feature idea submit an issue with a feature request or submit a pull request and we will work with you to merge it in!

License

The MIT License (MIT)

Copyright (c) 2021 Halil ibrahim EKİNCİ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
Preferences data store example

DataStore Example this example shows how you can use data store to store data in key value pairs and get rid of shared preferences Medium Article: htt

Keep data as a linked list on disk. A alternative way to reduce redundant operation for DiskLruCache
Keep data as a linked list on disk. A alternative way to reduce redundant operation for DiskLruCache

DiskLinkedList Keep data as a linked list on disk. An alternative way to reduce redundant operation for DiskLruCache Use-case Android have build-in Di

Kindling - A standalone collection of utilities to help Ignition users. Features various tools to help work with Ignition's custom data export formats A command line utility to help you investigate the sensitive data associated with Macie findings.
A command line utility to help you investigate the sensitive data associated with Macie findings.

Macie Finding Data Reveal This project contains a command line utility to help you investigate the sensitive data associated with Macie findings.

Little utilities for more pleasant immutable data in Kotlin
Little utilities for more pleasant immutable data in Kotlin

What can KopyKat do? Mutable copy Nested mutation Nested collections Mapping copyMap copy for sealed hierarchies copy from supertypes copy for type al

A robust native library loader for Android.
A robust native library loader for Android.

ReLinker A robust native library loader for Android. More information can be found in our blog post Min SDK: 9 JavaDoc Overview The Android PackageMan

Joda-Time library with Android specialization

joda-time-android This library is a version of Joda-Time built with Android in mind. Why Joda-Time? Android has built-in date and time handling - why

UPnP/DLNA library for Java and Android

Cling EOL: This project is no longer actively maintained, code may be outdated. If you are interested in maintaining and developing this project, comm

:iphone: [Android Library] Get device information in a super easy way.
:iphone: [Android Library] Get device information in a super easy way.

EasyDeviceInfo Android library to get device information in a super easy way. The library is built for simplicity and approachability. It not only eli

Releases(1.1.3)
Owner
Halil ibrahim EKİNCİ
Computer Engineer && Native Android Developer
Halil ibrahim EKİNCİ
Phrase is an Android string resource templating library

Phrase - Android string formatting CharSequence formatted = Phrase.from("Hi {first_name}, you are {age} years old.") .put("first_name", firstName)

Square 1.4k Dec 9, 2022
Fuzzy string matching for Kotlin (JVM, native, JS, Web Assembly) - port of Fuzzy Wuzzy Python lib

FuzzyWuzzy-Kotlin Fuzzy string matching for Kotlin (JVM, iOS) - fork of the Java fork of of Fuzzy Wuzzy Python lib. For use in on JVM, Android, or Kot

WillowTree, LLC 54 Nov 8, 2022
Format numbers using a string pattern with this simple number formatted like ##-####-##

AndroidPattern Format numbers using a string pattern with this simple number formatted like ##-####-## Installation To get a Git project into your bui

Hussein Habibi Juybari 2 Oct 25, 2021
KmmCaching - An application that illustrates fetching data from remote data source and caching it in local storage

An application that illustrates fetching data from remote data source and caching it in local storage for both IOS and Android platforms using Kotlin Multiplatform Mobile and SqlDelight.

Felix Kariuki 5 Oct 6, 2022
A simple Android utils library to write any type of data into cache files and read them later.

CacheUtilsLibrary This is a simple Android utils library to write any type of data into cache files and then read them later, using Gson to serialize

Wesley Lin 134 Nov 25, 2022
compaKTset is a small library aimed at providing you with the most memory efficient Set implementation for any particular data type of your choosing.

compaKTset is a small library aimed at providing you with the most memory efficient Set implementation for any particular data type of your choosing.

Ignat Beresnev 3 Nov 16, 2021
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML

A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.

null 603 Jan 1, 2023
A convenient library to show a shimmer effect while loading data

A convenient library to show a shimmer effect while loading data. Easily convert your current view with a slick skeleton loading animation just by wrapping your view.

Justin Guedes 11 Apr 28, 2022
Access and process various types of personal data in Android with a set of easy, uniform, and privacy-friendly APIs.

PrivacyStreams PrivacyStreams is an Android library for easy and privacy-friendly personal data access and processing. It offers a functional programm

null 269 Dec 1, 2022
An easy-to-use, cross-platform measurement tool that pulls data out of CD pipelines and analysis the four key metrics for you.

Maintained by SEA team, ThoughtWorks Inc. Read this in other languages: English, 简体中文 Table of Contents About the Project Usage How to Compute Contrib

Thoughtworks 277 Jan 7, 2023