Skip to content

Infinite not being used #161

Closed
Closed
@ghost

Description

Example:

extern crate num;

use num::{BigInt, BigRational, ToPrimitive};

fn main() {
    let n = BigInt::from(-2);
    let n = n.pow(4001);
    println!("{:?}", n.to_f64());
    let r = BigRational::from(n);
    println!("{:?}", r.to_f64());
}

Result:

None
Some(-inf)

I was expecting some minus infinite and got none. A workaround is to convert to BigRational but it is expensive, a clone is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions