cmpute / dashu

A library set of arbitrary precision numbers implemented in Rust.
Apache License 2.0
74 stars 9 forks source link

public IBig buffer, repr. #7

Closed ertosns closed 1 year ago

ertosns commented 1 year ago

i need to do big arith using dashu at some project, and read the integer 'iBig' buffer raw bytes, which is private, i can't read integer/repr from IBig, on the other hand as_sign_words, only return a single word.

cmpute commented 1 year ago

The signature of as_sign_words is

pub fn as_sign_words(&self) -> (Sign, &[Word])

It will return a reference to the underlying word array. Currently I'm not planning to allow taking the ownership of the word buffer, which requires exposing the internal representation as stable public API.

ertosns commented 1 year ago

@cmpute ok i see, i tried on a small number it returned single word, i thought it return the Small TypedRepr, i checked the code again, it return all held bytes in union ReprData. thanks.

you missing pow(FBig,FBig) btw, will push a PR soon.

cmpute commented 1 year ago

FBig::powf is implemented in v0.2.1, closing this issue.