Code Monkey home page Code Monkey logo

steppable's Introduction

The Steppable Project GitHub Repo stars

Repository Stats

CMake Build Doxygen Deploy

This project aims to make a Computer Algebra System (CAS) from scratch, and without any external libraries.

steppable's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

starrenamed

steppable's Issues

Bug - Incorrect Multiplication Result for Decimals less than 1

Describe the bug

When multiplying a decimal by another one, and when the result is less than 1, the result is incorrectly represented.

To Reproduce

Steps to reproduce the behavior:

  1. Run the multiply program with arguments 0.5 and 0.5.
  2. The calculation result is 0.025, instead of 0.25.

Expected behavior

Should output 0.25.

OS

  • All OS’s are affected.

Additional context

Not yet

Incorrect result from multiplication.

Describe the bug

When invoking the multiply function, or using the * operator in Python, an incorrect result may occur.

To Reproduce

Steps to reproduce the behavior:

  1. Create two steppyble numbers in the form of A0...B, e.g.: 203, 2003...
  2. Invoke the * operator to multiply the both.
  3. The result is incorrect. For example:
    >>> steppyble.Number("2003") * steppyble.Number("2003")
    4606900
    >>> 2003 * 2003
    4012009

OS

  • ALL PLATFORMS

`Knowledge` requests can be simplified for decimals and negative numerals

Is your feature request related to a problem? Please describe.
The knowledge index part of the components only targets positive integers. For others, even when a possible knowledge entry exists in the knowledge base file, it cannot be indexed.

Describe the solution you'd like
It is possible to remove the decimal point and the negative sign, and make it a positive integer for indexing. Then, in the end, convert the result to a suitable format for output.

Describe alternatives you've considered
None yet

Additional context
None yet

Bug: link error from the python binding

Details

libpython3.11.so is not being linked to the binding

error happened when importing the library in python:
ImportError: dlopen failed: cannot locate symbol "PyExc_ImportError" referenced by "/data/data/com.termux/files/home/Steppable/build/temp.linux-aarch64-cpython-311/steppyble/lib/steppyble.cpython-311.so"...

a readelf -d to the library:

  Tag        Type                         Name/Value
 0x000000000000001d (RUNPATH)            Library runpath: [/data/data/com.termux/files/usr/lib]
 0x0000000000000001 (NEEDED)             Shared library: [libc++_shared.so]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so]
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW
 0x0000000000000007 (RELA)               0xdb68
 0x0000000000000008 (RELASZ)             12672 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffff9 (RELACOUNT)          122
 0x0000000000000017 (JMPREL)             0x10ce8
 0x0000000000000002 (PLTRELSZ)           8160 (bytes)
 0x0000000000000003 (PLTGOT)             0x5c7b0
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000006 (SYMTAB)             0x308
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000005 (STRTAB)             0x60098
 0x000000000000000a (STRSZ)              35118 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x46b8
 0x0000000000000019 (INIT_ARRAY)         0x5c298
 0x000000000000001b (INIT_ARRAYSZ)       80 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x5c288
 0x000000000000001c (FINI_ARRAYSZ)       16 (bytes)
 0x000000006ffffff0 (VERSYM)             0x4148
 0x000000006ffffffe (VERNEED)            0x4678
 0x000000006fffffff (VERNEEDNUM)         2
 0x0000000000000000 (NULL)               0x0

To Reproduce

  1. build the project in termux-v0.118.0 (android) clang v17.0.6 cmake v3.28.3
  2. it happens

Expected behavior

an dlopen error will happen as the library is not appropriately linked

OS

  • Termux (aarch64-linux-android)

Additional context

library can be used if the libpython is manually added back to the dynamic section by using patchelf

Add `factorial`

Add a factorial function, $fact(x)$, which is defined as:

$$ fact(x) = x! = 1 \cdot 2 \cdot 3 \cdots x $$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.