Calculator that suffers from floating point precision

Overview

calc

A calculator that suffers from floating precision. This calculator suffers from floating point precision and isn't much more than a fun project. I recommend against using it as a calculator. If you have feedback I would love to hear it so I can improve. Makefile uses GCC with a recursive call to itself with the -j4 flag. The calculator is currently 100% terminal based.

how does it work? (from a user perspective)

Run the executable in the terminal, and give it some things to calculate.

Functions like sine (sin) and square root (sqrt) need their arguments in brackets, otherwise the program will throw an error.

sin(8+2) is correct.

sin 8 will throw an error.

How does it work? (from a code perspective)

Input is first saved as a string, and later formatted to exclude any spaces to make parsing it easier (as seen in input.c).

After that the string is passed to the lexical analyzer, which reads the string and converts it to a structure array to make calculating in the right order easier. The structure is as follows:

struct statement{
    double number;
    char operator;
    
    struct statement* statement;
    int type;
    
    unsigned int isNegative : 1;
};

This structure is saved as an array.

number is used to store... the number.

operator is the operation that's used on the number before it (the one in the same struct) and the one after it (which is in the index after the first one).

*statement is a pointer that's used to store brackets. If you have something like 2*(2+1) it will store the (2+1) in a new structure array which this pointer points to.

type is used for things like the square root, sine and cosine functions. In the calculator function it will perform that operation on the number that's put in between the brackets.

isNegative speaks for itself. It's used to make things like brackets negative.

A '\n' character is stored in the last part of the structure array to indicate that that's where the statement ends.

Issues
Owner
atiedebee
I like programming in C even though I'm still bad at it
atiedebee
Use fx-9860 series calculator as a keyboard for computer.

fxKeyboard Use fx-9860 series calculator as a keyboard for computer. WARNING: THIS TOOL MAY DAMAGE YOUR CALCULATOR OR COMPUTER. ALWAYS FOLLOW THE DOC

Myth 8 Jun 8, 2021
Open-source and open-hardware scientific RPN calculator

OpenRPNCalc Open-source and open-hardware scientific RPN calculator Introduction OpenRPNCalc is a scientific calculator based on STM32 microcontroller

Anton Poluektov 108 Nov 29, 2021
It is a basic calculator created by me in Pure C++

Basic-Calculator It is a basic calculator created by me in C++ If you find any bug then let me know How to use: 1. Enter first value it ask 2. Enter s

ryan 3 Sep 12, 2021
Create a calculator of any kind in any language, create a pr.

calculators Create a calculator of any kind in any language, create a pr. Create a calculator of any type using the programming language of your choic

Akshay Gautam 2 Dec 1, 2021
Calculator to determine unrealized gains or losses in % and $ form.

Personal-Project-G-L-Calculator in C++ Ryan Ramirez - [email protected] - UNLV Student Calculator to calculate unrealized gains or losses in % a

Ryan Ramirez 1 Oct 19, 2021
Improved Fractions Calculator using structures, user input parsing, and dynamic operator switching

Improved Fractions Calculator Program Structure: Main File: Runs fnctions from various header files. IO.h Header file containing IO functions, Interfa

Colin McCormack 1 Dec 5, 2021
Simple BMI Calculator application written in C++

BMI-Calculator Description Simple BMI Calculator application written in C++ Getting Started Authors Minyoung An @minyoung_an Version History 0.1 Initi

Minyoung An 1 Nov 25, 2021
RemixDB: A read- and write-optimized concurrent KV store. Fast point and range queries. Extremely low write-amplification.

REMIX and RemixDB The REMIX data structure was introduced in paper "REMIX: Efficient Range Query for LSM-trees", FAST'21. This repository maintains a

Xingbo Wu 50 Nov 18, 2021
Multi-GNSS Precise Point Postioning with Ambiguity Resolution

This is demo for multi-GNSS precise point positioning with ambiguity resolution (PPP-AR), which is based on RTKLIB and RTKLIB_demo5. FEATURES ppp-ar w

Chen Chao 16 Oct 26, 2021
An implementation of ICP(Iterative Closest Point).

An implementation of ICP(Iterative Closest Point). Users can specify which dimensions of transformation to optimize.

Ming Cao 3 Sep 23, 2021
Point in Polygon with 'CGAL'

The goal of insidecgal is to provide fast point in polygon lookup with cgal.

diminutive 3 Nov 12, 2021
This code converts a point cloud obtained by a Velodyne VLP16 3D-Lidar sensor into a depth image mono16.

pc2image This code converts a point cloud obtained by a Velodyne VLP16 3D-Lidar sensor into a depth image mono16. Requisites ROS Kinetic or Melodic Ve

Edison Velasco Sánchez 2 Dec 2, 2021
This repository uses a ROS node to subscribe to camera (hikvision) and lidar (livox) data. After the node merges the data, it publishes the colored point cloud and displays it in rviz.

fusion-lidar-camera-ROS 一、介绍 本仓库是一个ROS工作空间,其中ws_fusion_camera/src有一个工具包color_pc ws_fusion_camera │ README.md │ └───src │ └───package: c

hongyu wang 9 Nov 26, 2021
Simple IEEE 754 float point to register converter

i3ecnv Simple IEEE 754 float point to register converter Usage IEEE 754 converter: Type: i3ecnv <double value> Example 1 ./i3ecnv 1.2 Value DO

Fábio Pereira da Silva 1 Nov 28, 2021
The mainly point on this project is show how level of my comprehend for fragment SHADER.

PS The mainly point on this project is show how level of my comprehend for fragment SHADER. This project has some issue I can't solve else. cause I st

null 2 Nov 26, 2021
Direct LiDAR Odometry: Fast Localization with Dense Point Clouds

Direct LiDAR Odometry: Fast Localization with Dense Point Clouds DLO is a lightweight and computationally-efficient frontend LiDAR odometry solution w

VECTR at UCLA 15 Dec 2, 2021
LIDAR(Livox Horizon) point cloud preprocessing, including point cloud filtering and point cloud feature extraction (edge points and plane points)

LIDAR(Livox Horizon) point cloud preprocessing, including point cloud filtering and point cloud feature extraction (edge points and plane points)

hongyu wang 3 Nov 15, 2021
Inspect floating point computations

Floating point expression inspector The following tool lets you inspect the computational flow of a floating point expression, seeing where rounding o

Dale Weiler 102 Nov 17, 2021
Windows Calculator: A simple yet powerful calculator that ships with Windows

The Windows Calculator app is a modern Windows app written in C++ that ships pre-installed with Windows. The app provides standard, scientific, and programmer calculator functionality, as well as a set of converters between various units of measurement and currencies.

Microsoft 23.2k Dec 4, 2021
floating patches for rusty_v8

V8 JavaScript Engine V8 is Google's open source JavaScript engine. V8 implements ECMAScript as specified in ECMA-262. V8 is written in C++ and is used

Deno Land 45 Nov 26, 2021
tabbed window manager that can tile windows inside floating containers

tabbed window manager that can tile windows inside floating containers

Seninha 30 Nov 24, 2021
A simple floating clock for Linux

Hoverclock Hoverclock is a simple, yet customizable floating clock for Linux created with QT. Table of contents General info Technologies Quick note U

Kostoski Stefan 7 Nov 21, 2021
A simple C++ 03/11/etc timer class for ~microsecond-precision cross-platform benchmarking. The implementation is as limited and as simple as possible to create the lowest amount of overhead.

plf_nanotimer A simple C++ 03/11/etc timer class for ~microsecond-precision cross-platform benchmarking. The implementation is as limited and simple a

Matt Bentley 68 Nov 5, 2021
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.

libtommath This is the git repository for LibTomMath, a free open source portable number theoretic multiple-precision integer (MPI) library written en

libtom 482 Dec 2, 2021
C library for arbitrary-precision ball arithmetic

Arb Arb is a C library for arbitrary-precision interval arithmetic. It has full support for both real and complex numbers. The library is thread-safe,

Fredrik Johansson 316 Nov 27, 2021
An updated, 1.2.1 version of Equalizer APO running with internal double precision processing (64 bit)

EqualizerAPO - 64bit port This repo contains an updated, 1.2.1 64-bit port of EqualizerAPO - system wide equalizer for Windows. The port here is inspi

FireKahuna 24 Dec 7, 2021
IntX is a C++11 port of IntX arbitrary precision Integer library with speed, about O(N * log N) multiplication/division algorithms implementation.

IntX IntX is a C++11 port of IntX arbitrary precision Integer library with speed, about O(N * log N) multiplication/division algorithms implementation

Telepati 8 Nov 29, 2021
Extracts high-precision mouse/pointer motion data on Windows. Good for drawing software!

window_mouse_queue This is a wrapper for GetMouseMovePointsEx function that allows to extract high-precision mouse/pointer motion data on Windows. Goo

YellowAfterlife's GameMaker Things 3 Nov 1, 2021
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Cacahuète Sans Sel 17 Nov 24, 2021