Giter Site home page Giter Site logo

Problem with sqrt about evalex HOT 7 CLOSED

ezylang avatar ezylang commented on June 19, 2024
Problem with sqrt

from evalex.

Comments (7)

uklimaschewski avatar uklimaschewski commented on June 19, 2024

Thank you for the feedback, can you give me an example expression that reproduces this?

from evalex.

iyersathya avatar iyersathya commented on June 19, 2024

please try SRRT(24)

from evalex.

iyersathya avatar iyersathya commented on June 19, 2024

My mistake, I think it will only work on perfect squares.

from evalex.

squeek502 avatar squeek502 commented on June 19, 2024

SQRT(24) seems to work fine for me. Adding

assertEquals("4.8989794", new Expression("SQRT(24)").eval().toPlainString());

to the existing SQRT tests still passes.

from evalex.

uklimaschewski avatar uklimaschewski commented on June 19, 2024

What kind of Java and machine are you using? I tested in on a 64bit Intel Windows machine, without problem.

from evalex.

iyersathya avatar iyersathya commented on June 19, 2024

I am using mac pro (2.6 GHz Intel Core i7), Yes running junit tests on native machine works fine.
I am using Android's emulator on genymotion (ARM hypervisor), I also tried it on Samsung Galaxy 7 note ( ARM) and it gets stuck in a while loop.
Since its android , it is running on Dalvik VM, and the code is Dex'ed Dalvik code.
do { ixPrev = ix; ix = ix.add(n.divide(ix)).shiftRight(1); // Give other threads a chance to work; Thread.yield(); } while (ix.compareTo(ixPrev) != 0);
here's the loop result.
loop 1:
ixPrev=ix=4
ix = 5
loop 2:
ixPrev = ix = 5;
ix = 4
loop 3:
ixPrev=ix=4
ix=5

Hope that helps.

from evalex.

uklimaschewski avatar uklimaschewski commented on June 19, 2024

I have now tried out 4 different Android devices and 2 different emulator configurations, but I was unable to reproduce. I'll close this issue for now. If there is a way how I can reproduce this bug here, let me know.

from evalex.

Related Issues (20)

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.