Giter Club home page Giter Club logo

Comments (9)

michal-josef-spacek avatar michal-josef-spacek commented on August 28, 2024

Maybe we could move requires to Math::BigInt with version to test requires.

from perl-cryptx.

karel-m avatar karel-m commented on August 28, 2024

Should be fixed in CryptX-0.076_001

from perl-cryptx.

abraxxa avatar abraxxa commented on August 28, 2024

Please add the fix to the Changes file, thanks!

from perl-cryptx.

pjacklam avatar pjacklam commented on August 28, 2024

The first failing case,

$x = Math::BigFloat->new("0"); $y = Math::BigFloat->new("10"); $x->bcos($y);

is a bug fix. The output from bcos() was not rounded (by calling round()) when the result was zero. I assume the original author didn't round zero because rounding zero doesn't change the value. However, calling round() also sets the accuracy/precision of the object, which affects how the value is stringified. It also affects later computations involving the value. So for consistency, bcos() always calls round(), explicitly or implicitly. That's why the output is now "1.000000000" rather than just "1".

Ditto for the second failing case, which is identical except that the precision is 20, not 10.

from perl-cryptx.

pjacklam avatar pjacklam commented on August 28, 2024

The last case,

$x = Math::BigFloat::blog(Math::BigInt->new(100),10)

is worse. While I am encouraging users to switch to method calls rather than function calls, this should still have returned 2, not 100. I need to look further into that. Fortunately, the method call

$x = Math::BigFloat->blog(Math::BigInt->new(100),10)

gives the correct answer.

from perl-cryptx.

jkeenan avatar jkeenan commented on August 28, 2024

I encountered these test failures today when attempting to install CryptX on FreeBSD-12 against perl-5.36.0 as part of an attempt to diagnose Perl/perl5#19964. Output from make test:

t/mbi_ltm_01load.t .................. ok   
t/mbi_ltm_bigfltpm.t ................ 1/2408 
#   Failed test '$x = Math::BigFloat->new("0"); $y = Math::BigFloat->new("10"); $x->bcos($y);'
#   at ./t/mbi_ltm/bigfltpm.inc line 168.
#          got: '1.000000000'
#     expected: '1'

#   Failed test '$x = Math::BigFloat->new("0"); $y = Math::BigFloat->new("20"); $x->bcos($y);'
#   at ./t/mbi_ltm/bigfltpm.inc line 168.
#          got: '1.0000000000000000000'
#     expected: '1'
t/mbi_ltm_bigfltpm.t ................ 123/2408 Argument "" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 330.
Argument "" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 331.
Argument "" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 332.
Argument "abc" isn't numeric in subtraction (-) at /home/jkeenan/testing/v5.36.0/lib/perl5/site_perl/5.36.0/Math/BigFloat.pm line 4651, <DATA> line 333.
t/mbi_ltm_bigfltpm.t ................ 2329/2408 # Looks like you failed 2 tests of 2408.
t/mbi_ltm_bigfltpm.t ................ Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2408 subtests 
	(less 1 skipped subtest: 2405 okay)
t/mbi_ltm_bigintg.t ................. ok       
t/mbi_ltm_bigintpm.t ................ ok         
t/mbi_ltm_biglog.t .................. 1/71 
#   Failed test 'blog(100)'
#   at t/mbi_ltm_biglog.t line 123.
#          got: '100'
#     expected: '2'
# Looks like you failed 1 test of 71.
t/mbi_ltm_biglog.t .................. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/71 subtests 
t/mbi_ltm_bigroot.t ................. ok
...
Test Summary Report
-------------------
t/mbi_ltm_bigfltpm.t              (Wstat: 512 (exited 2) Tests: 2408 Failed: 2)
  Failed tests:  79, 81
  Non-zero exit status: 2
t/mbi_ltm_biglog.t                (Wstat: 256 (exited 1) Tests: 71 Failed: 1)
  Failed test:  41
  Non-zero exit status: 1
Files=135, Tests=24677, 22 wallclock secs ( 1.59 usr  0.25 sys + 18.89 cusr  2.34 csys = 23.08 CPU)
Result: FAIL
Failed 2/135 test programs. 3/24677 subtests failed.
*** Error code 255

Stop.
make: stopped in /usr/home/jkeenan/.cpan/build/CryptX-0.076-0

If the problem has been patched in the repository, do you have an ETA for a new CPAN release?

Thank you very much.
Jim Keenan

from perl-cryptx.

jkeenan avatar jkeenan commented on August 28, 2024

AFAICT, the most recent CPAN production release of CryptX was on Jan 07 2022. So while the issue may be patched on GitHub, we don't yet have a new release for final testing. Do you know when that will be issued?

from perl-cryptx.

karel-m avatar karel-m commented on August 28, 2024

... we don't yet have a new release for final testing. Do you know when that will be issued?

CryptX-0.077 released

from perl-cryptx.

jkeenan avatar jkeenan commented on August 28, 2024

... we don't yet have a new release for final testing. Do you know when that will be issued?

CryptX-0.077 released

All tests now PASS when installed against perl-5.36.0 and against blead. Thanks for your continued maintenance of this codebase.

from perl-cryptx.

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.