Giter Club home page Giter Club logo

Comments (12)

cuviper avatar cuviper commented on August 30, 2024 1

Thanks for the reminder - I've published num-bigint 0.2.1.

from num-bigint.

vks avatar vks commented on August 30, 2024

Is this necessary given that it is implemented in num-traits now?

from num-bigint.

cuviper avatar cuviper commented on August 30, 2024

What do you mean? Pow is defined in num-traits, and implemented for the primitive types, but we need to implement it here for bigints.

from num-bigint.

vks avatar vks commented on August 30, 2024

I thought num-traits provided a generic implementation, but apparently that is not the case.

from num-bigint.

thomwiggers avatar thomwiggers commented on August 30, 2024

Let's see if I can do this – I need in anyhow.

from num-bigint.

vks avatar vks commented on August 30, 2024

@cuviper I found it: num_traits::pow. This should work for BigInt as well. (Something like powm in this num-integer PR would probably be more efficient though.)

from num-bigint.

cuviper avatar cuviper commented on August 30, 2024

I found it: num_traits::pow. This should work for BigInt as well.

Yes, but that only works by-value with a usize exponent. The Pow trait is more flexible.

(Something like powm in this num-integer PR would probably be more efficient though.)

Modular pow is a different thing though -- and FWIW we do have inherent modpow methods here.

from num-bigint.

vks avatar vks commented on August 30, 2024

Yes, but that only works by-value with a usize exponent. The Pow trait is more flexible.

A u32 exponent should be enough, and by-value is more efficient.

from num-bigint.

windelbouwman avatar windelbouwman commented on August 30, 2024

I'm interested in this pow function, will there be a new release of this crate at some point containing pow, or is there work left to do?

from num-bigint.

peterbraden avatar peterbraden commented on August 30, 2024

Still not updated in num? I get:
Updating crates.io index Downloading num v0.2.0 Downloading num-bigint v0.2.1 Downloading num-rational v0.2.1 Compiling num-integer v0.1.39 Compiling num-iter v0.1.37 Compiling num-complex v0.2.1 Compiling num-bigint v0.2.1 Compiling num-rational v0.2.1 Compiling num-bigint v0.1.40 error[E0277]: the trait boundbiguint::BigUint: num_traits::Num is not satisfied

from num-bigint.

cuviper avatar cuviper commented on August 30, 2024

@peterbraden Somehow you have both new and old, Compiling num-bigint v0.2.1 and Compiling num-bigint v0.1.40. Only 0.2.1 implements Pow.

Your output doesn't show which num-traits you're compiling, but your two num-bigints will also require num-traits 0.2 and 0.1. That would be OK for Num (your error message) if the latter were 0.1.43, as that just re-exports the 0.2 versions. Alternatively, num-bigint 0.1.41 started using num-traits 0.2 as well, but it still won't have Pow.

from num-bigint.

peterbraden avatar peterbraden commented on August 30, 2024

I did a cargo update and all worked, not sure how I got into that state, thanks!

from num-bigint.

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.