in reply to Re^2: Puzzled by the bignum pragma
in thread Puzzled by the bignum pragma

From what I gather, the concern for perl is only to represent its Scalars/Things in the way it sees as best to fit, wouldn't more options allow for better optimisation/packing decisions.

In my view, fact one everyone learns about floats is that they are not an isometry to any other type, do bigfloat and bignum pragmas have some thing to say about this? Not that im asking, just that the notion that there is such is unfamiliar to me. hence why I opted for the did you mean internally line.

I would take it that inherent incompatibilty between floats and anything else would carry into qq/bigtypes/.


select( ${\()}, ${\\()} ? undef : Don, defined ${\0} ? undef : Coyote, 2/3)

Replies are listed 'Best First'.
Re^4: Puzzled by the bignum pragma
by NERDVANA (Priest) on Feb 05, 2025 at 05:32 UTC
    Incompatibility? A float is just two integers that plug into the formula  X * 2 ** Y. If you make X and Y arbitrary precision, many things can be converted to floats and back without loss of precision. And, every float can be represented as a rational number. (if Y is positive, it's just a bigint. If Y is negative, that's your denominator for a rational number)